I have been using the following to important .shp files into R fine for ages:
require(maptools)
require(rgeos)
shp <- lapply(list.files(pattern="*.shp"), readShapePoly)
If I am loading a handful of files it works fine. However, I am trying to load in ~1000 files and I just get the (common) error message:
Error in getinfo.shape(filen) : Error opening SHP file
I have been searching online but have not been able to find a solution. The working directory is set correctly, the accompanying .dbf .shx and .prj files are present for each shapefile. Also,
list.files(getwd(),pattern="shp")
does return every file. So I'm a bit confused, am I missing something obvious?
Thanks