Re: [R] Error opening SHP file

2016-01-22 Thread David Winsemius

> On Jan 22, 2016, at 9:24 AM, Amoy Yang via R-help  
> wrote:
> 
> This is the results that addresses David's advice.
>> library(maptools)
>> library(maps)
>> state.map <- readShapeSpatial("maps/st24_d00.shp")
> Error in getinfo.shape(fn) : Error opening SHP file
>> # David question: What does list.files('maps') return? Is there a 
>> 'st24_d00.shp' value in there?
>> list.files('maps')
> character(0)
> I actually use the link below to learn how to load state/zip-data on USA map.

That link says:

"For example (assumes you have the maryland shapefiles in the map 
subdirectory):"

So it did not purport to tell you how to put shape files in that subdirectory. 
That statement assumed you understood basic OS path naming conventions in your 
unstated OS and how to move files around, which is not a topic for rhelp.

Try working through the examples in the documents that come with the 
`sp`-package.

-- 
David.
> 
> # 
> http://stackoverflow.com/questions/1441717/plotting-color-map-with-zip-codes-in-r-or-python
> Plotting color map with zip codes in R or Python
> |   |
> |   |  |   |   |   |   |   |
> | Plotting color map with zip codes in R or PythonI have some US demographic 
> and firmographic data. I would like to plot zipcode areas in a state or a 
> smaller region (e.g. city). Each area would be annotated by col... |
> |  |
> | View on stackoverflow.com | Preview by Yahoo |
> |  |
> |   |
> 
>On Friday, January 22, 2016 10:03 AM, Barry Rowlingson 
>  wrote:
> 
> 
> We can duplicate the error by giving a path to a non-existent
> shapefile, which is probably the original problem:
> 
>> require(maptools)
> Loading required package: maptools
> Loading required package: sp
> Checking rgeos availability: TRUE
>> foo=readShapeSpatial("fnord.shp")
> Error in getinfo.shape(fn) : Error opening SHP file
> 
> The error message there isn't totally explicit, and might cover a
> range of other possibilities such as a corrupted shapefile, or a
> missing .shx component of the shapefile or whatever.
> 
> BUT you probably shouldn't be using readShapeSpatial anyway, as it has
> a habit of not reading the coordinate system in the .prj file. I find
> it much easier to use `raster::shapefile` which *does* read the
> coordinate system *and* gives a more explicit error message for a
> missing shapefile:
> 
>> require(raster)
> Loading required package: raster
>> foo=shapefile("fnord.shp")
> Error in normalizePath(x, winslash = "/", mustWork = TRUE) :
>   path[1]="fnord.shp": No such file or directory
> 
> "No such file or directory"
> 
> Barry
> 
> 
> 
> On Fri, Jan 22, 2016 at 2:25 AM, boB Rudis  wrote:
>> Agreed with the others. After finding that shapefile and getting it to
>> work you are definitely not in the proper working directory.
>> 
>> On Thu, Jan 21, 2016 at 8:40 PM, David Winsemius  
>> wrote:
>>> 
 On Jan 21, 2016, at 4:39 PM, Amoy Yang via R-help  
 wrote:
 
 Any advice for the following errors?
 state.map <- readShapeSpatial("maps/st24_d00.shp")
 Error in getinfo.shape(fn) : Error opening SHP file
>>> 
>>> What does list.files('maps') return? Is there a 'st24_d00.shp' value in 
>>> there?
>>> 
>>> 
>>> --
>>> David.
>>> 
 
> 
> 
> 
>   [[alternative HTML version deleted]]
  ^^
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

David Winsemius
Alameda, CA, USA

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Error opening SHP file

2016-01-22 Thread Amoy Yang via R-help
Let me just make this case simple and quick to address what I need.
Giving a data-file that includes tow columns: zip5 and population. How do I put 
pop (colored with different segments) by zips (with boundary) on the USA map 
with R?
Amoy 

On Friday, January 22, 2016 12:45 PM, David Winsemius 
 wrote:
 

 
> On Jan 22, 2016, at 9:24 AM, Amoy Yang via R-help  
> wrote:
> 
> This is the results that addresses David's advice.
>> library(maptools)
>> library(maps)
>> state.map <- readShapeSpatial("maps/st24_d00.shp")
> Error in getinfo.shape(fn) : Error opening SHP file
>> # David question: What does list.files('maps') return? Is there a 
>> 'st24_d00.shp' value in there?
>> list.files('maps')
> character(0)
> I actually use the link below to learn how to load state/zip-data on USA map.

That link says:

"For example (assumes you have the maryland shapefiles in the map 
subdirectory):"

So it did not purport to tell you how to put shape files in that subdirectory. 
That statement assumed you understood basic OS path naming conventions in your 
unstated OS and how to move files around, which is not a topic for rhelp.

Try working through the examples in the documents that come with the 
`sp`-package.

-- 
David.
> 
> # 
> http://stackoverflow.com/questions/1441717/plotting-color-map-with-zip-codes-in-r-or-python
> Plotting color map with zip codes in R or Python
> |  |
> |  |  |  |  |  |  |  |
> | Plotting color map with zip codes in R or PythonI have some US demographic 
> and firmographic data. I would like to plot zipcode areas in a state or a 
> smaller region (e.g. city). Each area would be annotated by col... |
> |  |
> | View on stackoverflow.com | Preview by Yahoo |
> |  |
> |  |
> 
>    On Friday, January 22, 2016 10:03 AM, Barry Rowlingson 
> wrote:
> 
> 
> We can duplicate the error by giving a path to a non-existent
> shapefile, which is probably the original problem:
> 
>> require(maptools)
> Loading required package: maptools
> Loading required package: sp
> Checking rgeos availability: TRUE
>> foo=readShapeSpatial("fnord.shp")
> Error in getinfo.shape(fn) : Error opening SHP file
> 
> The error message there isn't totally explicit, and might cover a
> range of other possibilities such as a corrupted shapefile, or a
> missing .shx component of the shapefile or whatever.
> 
> BUT you probably shouldn't be using readShapeSpatial anyway, as it has
> a habit of not reading the coordinate system in the .prj file. I find
> it much easier to use `raster::shapefile` which *does* read the
> coordinate system *and* gives a more explicit error message for a
> missing shapefile:
> 
>> require(raster)
> Loading required package: raster
>> foo=shapefile("fnord.shp")
> Error in normalizePath(x, winslash = "/", mustWork = TRUE) :
>  path[1]="fnord.shp": No such file or directory
> 
> "No such file or directory"
> 
> Barry
> 
> 
> 
> On Fri, Jan 22, 2016 at 2:25 AM, boB Rudis  wrote:
>> Agreed with the others. After finding that shapefile and getting it to
>> work you are definitely not in the proper working directory.
>> 
>> On Thu, Jan 21, 2016 at 8:40 PM, David Winsemius  
>> wrote:
>>> 
 On Jan 21, 2016, at 4:39 PM, Amoy Yang via R-help  
 wrote:
 
 Any advice for the following errors?
 state.map <- readShapeSpatial("maps/st24_d00.shp")
 Error in getinfo.shape(fn) : Error opening SHP file
>>> 
>>> What does list.files('maps') return? Is there a 'st24_d00.shp' value in 
>>> there?
>>> 
>>> 
>>> --
>>> David.
>>> 
 
> 
> 
> 
>     [[alternative HTML version deleted]]
      ^^
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

David Winsemius
Alameda, CA, USA


  
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] Error opening SHP file

2016-01-22 Thread boB Rudis
Look at the choroplethr package.

On Fri, Jan 22, 2016 at 5:31 PM, Amoy Yang  wrote:
> Let me just make this case simple and quick to address what I need.
>
> Giving a data-file that includes tow columns: zip5 and population. How do I
> put pop (colored with different segments) by zips (with boundary) on the USA
> map with R?
>
> Amoy
>
>
> On Friday, January 22, 2016 12:45 PM, David Winsemius
>  wrote:
>
>
>
>> On Jan 22, 2016, at 9:24 AM, Amoy Yang via R-help 
>> wrote:
>>
>> This is the results that addresses David's advice.
>>> library(maptools)
>>> library(maps)
>>> state.map <- readShapeSpatial("maps/st24_d00.shp")
>> Error in getinfo.shape(fn) : Error opening SHP file
>>> # David question: What does list.files('maps') return? Is there a
>>> 'st24_d00.shp' value in there?
>>> list.files('maps')
>> character(0)
>> I actually use the link below to learn how to load state/zip-data on USA
>> map.
>
> That link says:
>
> "For example (assumes you have the maryland shapefiles in the map
> subdirectory):"
>
> So it did not purport to tell you how to put shape files in that
> subdirectory. That statement assumed you understood basic OS path naming
> conventions in your unstated OS and how to move files around, which is not a
> topic for rhelp.
>
> Try working through the examples in the documents that come with the
> `sp`-package.
>
>
> --
> David.
>>
>> #
>> http://stackoverflow.com/questions/1441717/plotting-color-map-with-zip-codes-in-r-or-python
>> Plotting color map with zip codes in R or Python
>> |  |
>> |  |  |  |  |  |  |  |
>> | Plotting color map with zip codes in R or PythonI have some US
>> demographic and firmographic data. I would like to plot zipcode areas in a
>> state or a smaller region (e.g. city). Each area would be annotated by
>> col... |
>> |  |
>> | View on stackoverflow.com | Preview by Yahoo |
>> |  |
>> |  |
>>
>>On Friday, January 22, 2016 10:03 AM, Barry Rowlingson
>>  wrote:
>>
>>
>> We can duplicate the error by giving a path to a non-existent
>> shapefile, which is probably the original problem:
>>
>>> require(maptools)
>> Loading required package: maptools
>> Loading required package: sp
>> Checking rgeos availability: TRUE
>>> foo=readShapeSpatial("fnord.shp")
>> Error in getinfo.shape(fn) : Error opening SHP file
>>
>> The error message there isn't totally explicit, and might cover a
>> range of other possibilities such as a corrupted shapefile, or a
>> missing .shx component of the shapefile or whatever.
>>
>> BUT you probably shouldn't be using readShapeSpatial anyway, as it has
>> a habit of not reading the coordinate system in the .prj file. I find
>> it much easier to use `raster::shapefile` which *does* read the
>> coordinate system *and* gives a more explicit error message for a
>> missing shapefile:
>>
>>> require(raster)
>> Loading required package: raster
>>> foo=shapefile("fnord.shp")
>> Error in normalizePath(x, winslash = "/", mustWork = TRUE) :
>>  path[1]="fnord.shp": No such file or directory
>>
>> "No such file or directory"
>>
>> Barry
>>
>>
>>
>> On Fri, Jan 22, 2016 at 2:25 AM, boB Rudis  wrote:
>>> Agreed with the others. After finding that shapefile and getting it to
>>> work you are definitely not in the proper working directory.
>>>
>>> On Thu, Jan 21, 2016 at 8:40 PM, David Winsemius 
>>> wrote:

> On Jan 21, 2016, at 4:39 PM, Amoy Yang via R-help
>  wrote:
>
> Any advice for the following errors?
> state.map <- readShapeSpatial("maps/st24_d00.shp")
> Error in getinfo.shape(fn) : Error opening SHP file

 What does list.files('maps') return? Is there a 'st24_d00.shp' value in
 there?


 --
 David.

>
>>
>>
>>
>> [[alternative HTML version deleted]]
>   ^^
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> 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.
>
> David Winsemius
> Alameda, CA, USA
>
>

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Error opening SHP file

2016-01-22 Thread Barry Rowlingson
We can duplicate the error by giving a path to a non-existent
shapefile, which is probably the original problem:

 > require(maptools)
Loading required package: maptools
Loading required package: sp
Checking rgeos availability: TRUE
 > foo=readShapeSpatial("fnord.shp")
Error in getinfo.shape(fn) : Error opening SHP file

The error message there isn't totally explicit, and might cover a
range of other possibilities such as a corrupted shapefile, or a
missing .shx component of the shapefile or whatever.

BUT you probably shouldn't be using readShapeSpatial anyway, as it has
a habit of not reading the coordinate system in the .prj file. I find
it much easier to use `raster::shapefile` which *does* read the
coordinate system *and* gives a more explicit error message for a
missing shapefile:

 > require(raster)
Loading required package: raster
 > foo=shapefile("fnord.shp")
Error in normalizePath(x, winslash = "/", mustWork = TRUE) :
  path[1]="fnord.shp": No such file or directory

"No such file or directory"

Barry



On Fri, Jan 22, 2016 at 2:25 AM, boB Rudis  wrote:
> Agreed with the others. After finding that shapefile and getting it to
> work you are definitely not in the proper working directory.
>
> On Thu, Jan 21, 2016 at 8:40 PM, David Winsemius  
> wrote:
>>
>>> On Jan 21, 2016, at 4:39 PM, Amoy Yang via R-help  
>>> wrote:
>>>
>>> Any advice for the following errors?
>>> state.map <- readShapeSpatial("maps/st24_d00.shp")
>>> Error in getinfo.shape(fn) : Error opening SHP file
>>
>> What does list.files('maps') return? Is there a 'st24_d00.shp' value in 
>> there?
>>
>>
>> --
>> David.
>>
>>>
>>>   [[alternative HTML version deleted]]
>>>
>>> __
>>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>> 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.
>>
>> David Winsemius
>> Alameda, CA, USA
>>
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> 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@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Error opening SHP file

2016-01-22 Thread Amoy Yang via R-help
This is the results that addresses David's advice.
> library(maptools)
> library(maps)
> state.map <- readShapeSpatial("maps/st24_d00.shp")
Error in getinfo.shape(fn) : Error opening SHP file
> # David question: What does list.files('maps') return? Is there a 
> 'st24_d00.shp' value in there?
> list.files('maps')
character(0)
I actually use the link below to learn how to load state/zip-data on USA map.

# 
http://stackoverflow.com/questions/1441717/plotting-color-map-with-zip-codes-in-r-or-python
Plotting color map with zip codes in R or Python
|   |
|   |  |   |   |   |   |   |
| Plotting color map with zip codes in R or PythonI have some US demographic 
and firmographic data. I would like to plot zipcode areas in a state or a 
smaller region (e.g. city). Each area would be annotated by col... |
|  |
| View on stackoverflow.com | Preview by Yahoo |
|  |
|   |




 

On Friday, January 22, 2016 10:03 AM, Barry Rowlingson 
 wrote:
 

 We can duplicate the error by giving a path to a non-existent
shapefile, which is probably the original problem:

 > require(maptools)
Loading required package: maptools
Loading required package: sp
Checking rgeos availability: TRUE
 > foo=readShapeSpatial("fnord.shp")
Error in getinfo.shape(fn) : Error opening SHP file

The error message there isn't totally explicit, and might cover a
range of other possibilities such as a corrupted shapefile, or a
missing .shx component of the shapefile or whatever.

BUT you probably shouldn't be using readShapeSpatial anyway, as it has
a habit of not reading the coordinate system in the .prj file. I find
it much easier to use `raster::shapefile` which *does* read the
coordinate system *and* gives a more explicit error message for a
missing shapefile:

 > require(raster)
Loading required package: raster
 > foo=shapefile("fnord.shp")
Error in normalizePath(x, winslash = "/", mustWork = TRUE) :
  path[1]="fnord.shp": No such file or directory

"No such file or directory"

Barry



On Fri, Jan 22, 2016 at 2:25 AM, boB Rudis  wrote:
> Agreed with the others. After finding that shapefile and getting it to
> work you are definitely not in the proper working directory.
>
> On Thu, Jan 21, 2016 at 8:40 PM, David Winsemius  
> wrote:
>>
>>> On Jan 21, 2016, at 4:39 PM, Amoy Yang via R-help  
>>> wrote:
>>>
>>> Any advice for the following errors?
>>> state.map <- readShapeSpatial("maps/st24_d00.shp")
>>> Error in getinfo.shape(fn) : Error opening SHP file
>>
>> What does list.files('maps') return? Is there a 'st24_d00.shp' value in 
>> there?
>>
>>
>> --
>> David.
>>
>>>
>>>      [[alternative HTML version deleted]]
>>>
>>> __
>>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>> 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.
>>
>> David Winsemius
>> Alameda, CA, USA
>>
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> 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@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


  
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] Error opening SHP file

2016-01-21 Thread David Winsemius

> On Jan 21, 2016, at 4:39 PM, Amoy Yang via R-help  
> wrote:
> 
> Any advice for the following errors?
> state.map <- readShapeSpatial("maps/st24_d00.shp")
> Error in getinfo.shape(fn) : Error opening SHP file

What does list.files('maps') return? Is there a 'st24_d00.shp' value in there?


-- 
David.

> 
>   [[alternative HTML version deleted]]
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

David Winsemius
Alameda, CA, USA

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Error opening SHP file

2016-01-21 Thread Jim Lemon
Hi Amoy,
Another mystery question. I should have pursued parapsychology. That error
statement is usually followed by one noting that the file specified cannot
be found. Today's guess is that the R working directory:

getwd()

did not have a "maps" directory below it.

Jim


On Fri, Jan 22, 2016 at 11:39 AM, Amoy Yang via R-help  wrote:

>  Any advice for the following errors?
> state.map <- readShapeSpatial("maps/st24_d00.shp")
> Error in getinfo.shape(fn) : Error opening SHP file
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Error opening SHP file

2016-01-21 Thread boB Rudis
Agreed with the others. After finding that shapefile and getting it to
work you are definitely not in the proper working directory.

On Thu, Jan 21, 2016 at 8:40 PM, David Winsemius  wrote:
>
>> On Jan 21, 2016, at 4:39 PM, Amoy Yang via R-help  
>> wrote:
>>
>> Any advice for the following errors?
>> state.map <- readShapeSpatial("maps/st24_d00.shp")
>> Error in getinfo.shape(fn) : Error opening SHP file
>
> What does list.files('maps') return? Is there a 'st24_d00.shp' value in there?
>
>
> --
> David.
>
>>
>>   [[alternative HTML version deleted]]
>>
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> 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.
>
> David Winsemius
> Alameda, CA, USA
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


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

2008-03-11 Thread Paul Hiemstra
[EMAIL PROTECTED] schreef:
 I am having difficulty loading a points shapefile (1600 records) I generated 
 from ArcGIS as a PointsSpatialDataFrame using the maptools readShapePoints 
 function.

 library(maptools)
 surveypts - readShapePoints(system.file(C:/temp/survey.shp, 
 package=maptools)[1]
 Error in getinfo.shape(filen) : Error opening SHP file

 I've tried numerous re-exports and renames of the dataset, to no avail. I've 
 also tried placing the shapefile in the library's shapefile folder, with the 
 example dataset (see example below). 

 x - readShapePoints(system.file(shapes/survey.shp, package=maptools)[1]

 No luck there either. I'm quite new to R, but I can follow a manual and 
 google well enough. However, I haven't seen anything to help me. The example 
 point datasets load fine. I figure that I'm missing on some familiarity with 
 R and that I don't know the tricks yet. Any help?

 Thanks in advance.

 Gericke Cook
 USDA-APHIS-PPQ

 __
 R-help@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.
   
Hi Gericke,

Why do you use system.file? Probably it will look for survey.shp in the 
maptools package. Try instead:

surveypts - readShapePoints(C:/temp/survey.shp)

For these kind of geographic questions, the r-sig-geo mailing list is 
maybe a better way to get good answers.

cheers and hth,
Paul

-- 
Drs. Paul Hiemstra
Department of Physical Geography
Faculty of Geosciences
University of Utrecht
Heidelberglaan 2
P.O. Box 80.115
3508 TC Utrecht
Phone: +31302535773
Fax:+31302531145
http://intamap.geo.uu.nl/~paul

__
R-help@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.


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

2008-03-11 Thread Don MacQueen
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')

Hope this helps.
-Don

At 12:05 PM -0600 3/11/08, [EMAIL PROTECTED] wrote:
I am having difficulty loading a points shapefile (1600 records) I 
generated from ArcGIS as a PointsSpatialDataFrame using the maptools 
readShapePoints function.

library(maptools)
surveypts - readShapePoints(system.file(C:/temp/survey.shp, 
package=maptools)[1]
Error in getinfo.shape(filen) : Error opening SHP file

I've tried numerous re-exports and renames of the dataset, to no 
avail. I've also tried placing the shapefile in the library's 
shapefile folder, with the example dataset (see example below).

x - readShapePoints(system.file(shapes/survey.shp, package=maptools)[1]

No luck there either. I'm quite new to R, but I can follow a manual 
and google well enough. However, I haven't seen anything to help me. 
The example point datasets load fine. I figure that I'm missing on 
some familiarity with R and that I don't know the tricks yet. Any 
help?

Thanks in advance.

Gericke Cook
USDA-APHIS-PPQ

__
R-help@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.


-- 
-
Don MacQueen
Lawrence Livermore National Laboratory
Livermore, CA, USA
925-423-1062
[EMAIL PROTECTED]

__
R-help@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.