Re: [R] maptools no such file

From: Roger Bivand <Roger.Bivand_at_nhh.no>
Date: Mon, 28 Jan 2008 11:35:39 +0000 (UTC)

 <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.
>
>



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. Received on Mon 28 Jan 2008 - 11:39:30 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 28 Jan 2008 - 22:30:09 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive