如何将多个.shp
文件作为一个对象读取?
我想像在代码下一样简单地阅读。
nc <- st_read(dsn = "nc",
layer = c("nc1","nc2"))
将多个文件作为对象读取的最佳方法是什么?
library(sf)
nc <- st_read(system.file("shape/nc.shp", package="sf"))
nc1 <- nc[1:50, ]
nc2 <- nc[51:100, ]
st_write(nc1,
dsn = "nc",
layer = "nc1",
driver = "ESRI Shapefile")
st_write(nc2,
dsn = "nc",
layer = "nc2",
driver = "ESRI Shapefile",update = T)