I am attempting to read in a series of polygon shapefiles from a directory and batch merge them into a single shapefile. They all have the exact same field names. I am using this code:
all_data <- do.call(rbind, lapply(data, rgdal::readOGR))
#data is a list of files that exist in the directory, but it does not
#contain all of the files in that directory.
After reading in all of my files with readOGR, r returns this error and the bind fails:
Error in match.arg(method) : 'arg' must be of length 1
any ideas about what might be causing this error?
lapply
and then trying torbind
bits of it.sps = lapply(data, rgdal::readOGR)
and thenrbind(sps[[1]], sps[[2]])
and so on. Without your data I don't think we can be more specific.