Re: [R] Error opening SHP file (maptools)

From: Roger Bivand <>
Date: Wed, 12 Mar 2008 13:28:04 +0000 (UTC)

Don MacQueen <macq <at>> writes:

> The help page for readShapePoints says that the file name that you
> supply should not include the extension.
> The "system.file" part of the example in the help page is only to use
> the example file that came with the package. Since you want to open
> your own file you omit the system.file() bit.
> Do something like:
> readShapePoints( 'C:/path_to_my_file/filename')

You may also - for safety's sake - say:

list.files(path="C:/path_to_my_file", pattern="filename")

to make sure that at least the minimum three files that make up a "shapefile" are present: filename.dbf, filename.shp, and filename.shx. Note that in Windows you can also use the file chooser, by saying:


which will let you navigate to, and "see" the file name for yourself.


PS. As Paul mentioned, the R-sig-geo list is well suited to this kind of question.

> Hope this helps.
> -Don
> mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Wed 12 Mar 2008 - 13:46:24 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 Wed 12 Mar 2008 - 14:30:21 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive