###
# columbus
require("maptools")
example(columbus)
# example of use of neighbourmap
neighbourmap(columbus, "CRIME", col.gal.nb,
criteria=(columbus@data$CRIME>mean(columbus@data$CRIME)))
###
# data immob
data(immob)
# change names of individuals
row.names(immob) <- immob$Nom
# immob is a data.frame object. We have to create
# a Spatial object, by using first the longitude and latitude
# to create Spatial Points object ...
immob.sp = SpatialPoints(cbind(immob$longitude,immob$latitude))
# ... and then by integrating other variables to create SpatialPointsDataFrame
immob.spdf = SpatialPointsDataFrame(immob.sp, immob)
# For more details, see vignette('sp', package="sp")
# optional : we add some contours that don't correspond to the spatial unit
# but are nice for mapping
midiP <- readShapePoly(system.file("shapes/region.shp", package="GeoXp")[1])
cont_midiP<-spdf2list(midiP[-c(22,23),])$poly
# A spatial weight matrix based on triangulation Delaunay
W.nb<-tri2nb(cbind(immob$longitude,immob$latitude))
# example of use of neighbourmap
neighbourmap(immob.spdf,"prix.vente", W.nb, identify=TRUE, cex.lab=0.5,
carte=cont_midiP)
Run the code above in your browser using DataLab