Last active
December 18, 2015 23:49
-
-
Save kpq/5864255 to your computer and use it in GitHub Desktop.
How to plot points and shapes in R, bc I always forget the reprojecting stuff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(rgdal) | |
# a clean data frame called d2 | |
maptest <- d2 | |
coordinates(maptest) <- c("lng", "lat") | |
proj4string(maptest) <- CRS("+proj=longlat") | |
ogrInfo(dsn = "shapes", "County") | |
proj4string(shapes) <- "+proj=utm +zone=18 +datum=NAD83 +units=m +no_defs " | |
new_shapes <- spTransform(shapes, CRS("+proj=longlat")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment