[R] adjacency matrix

Christophe Declercq cdeclercq at nordnet.fr
Thu Oct 23 19:43:35 CEST 2003


> 
> ----- Original Message ----- 
> From: "Orlando Zacarias" <si-opz at dsv.su.se>
> To: <cdeclercq at nordnet.fr>
> Cc: <r-sig-geo at stat.math.ethz.ch>; <r-help at stat.math.ethz.ch>
> Sent: Thursday, October 23, 2003 6:56 PM
> Subject: RE: [R] adjacency matrix
> 
> 
> 
> Hi once again,
> Now i have been trying to run the R changed example from Maptools
> package manual, and errors occur underlined bellow. It is really
> troublesome....
> Please assist,
> Orlando.
> ---------------------------------------------------
> shp <- try(library(shapefiles))  
> Error in library(maptools) : There is no package called 'shapefiles'

The message is clear!

> > if (class(shp) != "try-error") {
> + ShapeDir <- system.file("shapes", package="maptools")[1]
> + try1 <- read.shapefile(paste(ShapeDir, "shapes", sep="/"))
> + shppolys <- shape2poly(try1, as.character(try1$dbf$dbf$NEIGNO))
> + plotpolys(shppolys)
> + title(main="Polygons for Vermani from shapefiles package")
> + }
> > 
> > try2 <- read.shape(system.file("shapes/Vermani.shp",
> + package="maptools/man")[1])
> Error: couldn't find function "read.shape"
> > mappolys <- Map2poly(try2, as.character(try2$att.data$NEIGNO))
> Error: couldn't find function "Map2poly"
> > plotpolys(mappolys)
> Error: couldn't find function "plotpolys"
> > title(main="Polygons for Vermani from maptools package")
> Error in title(main = "Polygons for Vermani from maptools package") : 
>         plot.new has not been called yet
> > if (class(shp) != "try-error") {
> + plotpolys(shppolys)
> + plotpolys(mappolys, add=TRUE, border="red", lty="dotted")
> + title(main="Polygons for Vermani overplotted from both packages")
> + }
> ------------------------------------------------------

Did you forget:
> library(maptools)
before that?

Christophe




More information about the R-help mailing list