Looking closely at your error message, it shows two empty double quotes at the end of the last line (and also are there more lines missing?)...
proj4string = CRS(""
this isn't what you've got in your code line:
proj4string = CRS("+proj=utm +zone=18 +datum=WGS84 +units=m +no_defs"))
That code line works fine when I cut and paste it. So either this isn't the code line that generated the error or there's something lost in translation.
Error: unexpected string constant
is a syntax error related to the basic form of an R expression - its not related to the spatial functions at all. I can generate one like this:
> x = """abc"
Error: unexpected string constant in "x = """abc""
R sees the first two "
marks as making an empty string, and then it gets surprised by the "abc"
that then appears. Since the projection string is the only string visible in your code line, the problem must be similar, and located there. For example this will recreate your error message:
CRS("""+proj=utm +zone=18 +datum=WGS84 +units=m +no_defs"))
Notice the three quote marks at the start.
Check carefully the matching of quote marks in your code and if it still really looks like CRS("+proj....")
then type the line in again because the remaining possibility is that there are some invisible, non-printing in your code. Delete the line and type it again.
Here's a fully reproducible example that starts with a small data set of 10 points just for testing. Run this from a fresh R session and see what happens.
library(sp)
net = data.frame(runif(10), runif(10), runif(10))
NET.TO.EXTRAC_1 = SpatialPointsDataFrame(coords = net[,3:2], data = net, proj4string = CRS("+proj=utm +zone=18 +datum=WGS84 +units=m +no_defs"))
NET.TO.EXTRAC_1
## coordinates runif.10. runif.10..1 runif.10..2
## 1 (0.987805, 0.1249515) 0.8486718 0.1249515016 0.98780497
## 2 (0.9780648, 0.5670319) 0.7146658 0.5670319169 0.97806482
## 3 (0.9244074, 0.1650072) 0.1201483 0.1650071603 0.92440741
## 4 (0.1341612, 0.09074656) 0.9757170 0.0907465599 0.13416121