I want to subset out a shapefile (the .shp and associated files are here) into another one bounded by a set of coordinates, say between longs [80,90] and lats [20,30], and t
Another way:
library(raster) s <- shapefile("/path/asia_rivers.shp") sub <- crop(s, extent(80, 90, 20, 30)) shapefile(sub, 'cropped_rivers.shp')