Re: [R] maptools no such file

From: Roger Bivand <Roger.Bivand_at_nhh.no>
Date: Mon, 28 Jan 2008 12:19:53 +0000 (UTC)

Roger Bivand <Roger.Bivand <at> nhh.no> writes:

>
> <pieterprovoost <at> gmail.com> writes:
>
> >
> > No, I get the same error message there...
>
> 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")
>
> which is self-explanatory, because you were not using read.shape() anyway.

OK - this was your test that the file existed. read.dbf("cities.dbf") might have been more helpful.

To check that there is no "spaces in path names" problem here, I tried:

> library(maptools)
> getwd()

[1] "/home/rsb/tmp/bigshape/R scripts"
> list.files(pattern="shp$")
[1] "co37_d90.shp"
> getinfo.shape("co37_d90.shp")

Shapefile type: Polygon, (5), # of Shapes: 104
> shp <- read.shape("co37_d90.shp")
Shapefile type: Polygon, (5), # of Shapes: 104

admittedly on Linux and with an up-to-date package. I have also checked on Windows XP, also with current maptools and R 2.6.1, with the same result. Seeing your sessionInfo() would show both your platform and package version.

Roger

> 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 - 12:23:54 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 - 12:30:08 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