
densitymap
draws kernel density estimates of the variable name.var
with
bkde
and a map with sites of coordinate coordinates(sp.obj)
. Each site is associated
to a value of name.var
and there is interactivity between the two windows.
densitymap(sp.obj, name.var, kernel='triweight',
names.attr=names(sp.obj), criteria=NULL, carte=NULL, identify=FALSE, cex.lab=0.8, pch=16,
col="lightblue3", xlab="", ylab="", axes=FALSE, lablong="", lablat="")
save results
button,
a vector of integer is created as a global variable in last.select
object.
It corresponds to the number of spatial units selected just before leaving the Tk window.
Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S. New York: Springer.
Wand M.P. et Jones M.C. (1995), Kernel Smoothing, Chapman \& Hall.
histomap
, histobarmap
, scattermap
, densitymap
######
# data oldcol
require("maptools")
example(columbus)
# columbus is included in the Spatial-Class object
# a very simple use of histomap :
densitymap(columbus,"CRIME")
######
# data on price indices of real estate in France
data(immob)
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 basic call of densitymap function
densitymap(immob.spdf,"prix.vente", carte= cont_midiP, identify=TRUE,
xlab="housing price by square meter", cex.lab=0.6)
Run the code above in your browser using DataLab