[R-sig-Geo] ReadShapePoly subsetting data
Peter Larson
pslarson2 at gmail.com
Mon May 31 04:53:30 CEST 2010
It doesn't seem to work. This what I have though.
I have a STATE_NAME variable in the data that I could potentially use,
assuming I know the write syntax.
Any ideas?
Thanks!
Pete
nc_file <- system.file("/LynchingHotSpots.shp", package="maptools")[1]
llCRS <- CRS("+proj=longlat +datum=NAD27")
nc <- readShapePoly("LynchingHotSpots.shp", proj4string=llCRS)
statesWanted <- c("MN","WI")
nc <- nc[nc$STATE_NAME %in% statesWanted,]
print(spplot(nc, c("Lynchings")))
More information about the R-sig-Geo
mailing list