Skip to content
Prev 6759 / 29559 Next

Guerry data: making a package

On Sat, 17 Oct 2009, Michael Friendly wrote:

            
readShapeSpatial() is a wrapper for readShapePoly() and others, choosing 
on shape type. The message suggests that the *.shx file is not as 
expected.

With a freshly downloaded copy from your website, I cannot reproduce the 
problem, and gfrance1.shp reads correctly on:
R version 2.10.0 (2009-10-26)
i686-pc-linux-gnu

locale:
  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
  [5] LC_MONETARY=C              LC_MESSAGES=en_US.UTF-8
  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
  [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] maptools_0.7-26 foreign_0.8-38  sp_0.9-44

loaded via a namespace (and not attached):
[1] grid_2.10.0     lattice_0.17-26
The prompt method for data either identifies data.frame objects or dumps 
the object. For me,

prompt(as(gfrance, "data.frame"), name="gfrance")

looks easier to edit, adding the class details.

Hope this helps,

Roger