geo_dd geo_dd - 3 years ago 372
R Question

Error in getinfo.shape(fn) : Error opening SHP file in R

I have thousand files and each one contains a

. The names of my files are
and the names of the
are the same.I am trying to read them in R and then export them (all
in one file) but I get the error
"Error in getinfo.shape(fn) : Error opening SHP file"

my code so far:

for (i in 1:5000){

How can I read the
from the files and export them in one?

Answer Source

Don't forget to paste your string:

for (i in 1:5000){

Example of paste0:

> i=1
> paste0("fle/file_sh",i,"/file_sh",i,".shp")
[1] "fle/file_sh1/file_sh1.shp"

For the second part of your question, see here or here or here.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download