[R] maptools no such file

Roger Bivand Roger.Bivand at nhh.no
Mon Jan 28 12:35:39 CET 2008


 <pieterprovoost <at> gmail.com> writes:

> 
> No, I get the same error message there...

Please do not needlesly delete the thread content. Your original question was:

"I'm having problems reading a shapefile with read.shape (maptools). I'm
absolutely sure my file is there, but I get "no such file". The wd is ok,
since read.table for example does find the file.

> getwd()
[1] "D:/somedirectory/R scripts"
> read.table("cities.shp")
Error in read.table("cities.shp") : empty beginning of file
In addition: Warning message:
In read.table("cities.shp") :
  incomplete final line found by readTableHeader on 'cities.shp'"

which is self-explanatory, because you were not using read.shape() anyway.

You continued:

"> read.shape("cities.shp")
Error in getinfo.shape(filen) : No such file"

but did not respond to the suggestion from an R-helper with the output from:

readShapePoly("cities.shp")

Try list.files(pattern="shp$") to see whether your assumption that the files are
where you think they are, is justified.

Then get back with the output of

getinfo.shape("cities.shp")

If you want to, you can use file.choose() to choose the file interactively.

If you haven't solved this yourself by then (found the files youself), do
remember to include the verbatim output of sessionInfo() too.

Roger Bivand


> 
> --
> This message was sent on behalf of pieterprovoost <at> gmail.com at
openSubscriber.com
> http://www.opensubscriber.com/message/r-help <at> r-project.org/8476734.html
> 
> ______________________________________________
> R-help <at> r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
>



More information about the R-help mailing list