0
votes

I'm working with two geospatial datasets in R. But the coordinates were captured using two different CRS. One dataset used WGS84 and the other used NAD83. Is it at all possible to convert the WGS84 dataset to NAD83 and vice versa? I've heard the sf and rgdal libraries can do this but aren't they exclusive to shapefiles?

1
Can't you read the shapefile into r and then transform? sf::st_transform()?Eyayaw

1 Answers

1
votes

This is more a comment but I don't have the rep to comment! If you're using sp class objects like SpatialPointsDataFrame then sp::spTransform will convert reference systems. If you're using sf then you need stTransform. For example, if df is a SpatialPointsDataFrame with NAD84 then to get to WGS84

df2 <- spTransform(df,CRS("+init=epsg:4326"))

There's a good vignette here here