I have a csv file with three columns in the form of value x y
.
I know that x and y refer to EPSG 25832.
I need to transform these coordinates to EPSG 4326 since, when I call summary()
on the shapefile where I want to plot the data, I get this line:
proj4string :
[+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0]
WGS84 corresponds to EPSG 4326, right?
By reading other answers I understood that I need to use the spTransform function from the rgdal package. However I didn't find any thorough explanation of the function usage. Please help!
The documentation was quite cryptic to me (I am new to R and spatial data), so it didn't help me out.
EDIT: adding the output of dput(head(data))
structure(list(Value = c(10L, 9L, 17L, 13L, 10L, 6L), X = c(687199.0608,
687199.0608, 687199.0608, 687199.0608, 687199.0608, 687199.0608
), Y = c(4928179.721, 4928179.721, 4928179.721, 4928179.721,
4928179.721, 4928179.721)), .Names = c("Value", "X", "Y"), row.names = c(NA,
-6L), class = c("tbl_df", "tbl", "data.frame"))
csv
file (i.e.head(csv)
), ideally the output fromdput(head(csv))
? – Phil