[R-sig-Geo] Srings

Roger Bivand Roger.Bivand at nhh.no
Mon Oct 17 19:57:27 CEST 2005


On Mon, 17 Oct 2005, Denis Chabot wrote:

> Hi Roger,
> 
> I don't know what is happening, maybe a mismatch of some packages  
> from my R2.1 (old) install and my new R2.2 install, but I'm having  
> problems with function
> 
> asSpatialRingsShapes
> 
> that was used in the method you developed to import shapefiles into  
> files that are compatible with PBSmapping. The problem is not with  
> the functions you wrote for me, actually, but with a function that is  
> part of maptools. This is actually part of the example given in the  
> help file for asSpatialRingsShapes. R chokes on Sring:
> 
>  > library(maptools)
>  > nc.shp <- read.shape(system.file("shapes/sids.shp",  
> package="maptools")[1])
> Shapefile type: Polygon, (5), # of Shapes: 100
>  > nc1 <- asSpatialRingsShapes(nc.shp$Shapes, as.character(nc.shp 
> $att.data$FIPS))
> Erreur : impossible de trouver la fonction "Sring"
> 
> 
> Do others have problems with this function?

The name changed with a major improvement in the internal structure: the 
classes are (were/are) Sring|Polygon, Srings|Polygons, etc. Recent 
releases of maptools (since 0.5) depend on sp, and readShapePoly() now 
imports a shapefile into a SpatialPolygonsDataFrame object directly. We 
did announce the change, and the posting is available at:

http://r-spatial.sourceforge.net/changes081.txt

where we also wrote:

"Following very useful input from users, a number of incompatible changes 
are being introduced into sp from release 0.8-*. We hope that users will 
export data objects in the deprecated formats before updating."

Older versions of sp are available from the CRAN archive if needed.

Hope this helps,

Roger


> 
> Sincerely,
> 
> Denis
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no




More information about the R-sig-Geo mailing list