Description Usage Arguments Details Value Author(s) References See Also Examples
The function dbledensitymap
plots two kernel density estimates from 2 variables included
in names.var
computed with bkde
, and a map with sites of coordinates
coordinates(sp.obj)
. Each site is associated to a value of names.var[1]
and
names.var[2]
and the two windows are interactive.
1 2 3 |
sp.obj |
object of class extending Spatial-class |
names.var |
a vector of character of size 2; attribute names or column numbers in attribute table |
kernel |
Smoothing kernel (see help(bkde) for list of options) |
names.attr |
names to use in panel (if different from the names of variable used in sp.obj) |
criteria |
a vector of boolean of size the number of spatial units, which permit to represent preselected sites with a cross, using the tcltk window |
carte |
matrix with 2 columns for drawing spatial polygonal contours : x and y coordinates of the vertices of the polygon |
identify |
if not FALSE, identify plotted objects (currently only working for points plots). Labels for identification are the row.names of the attribute table row.names(as.data.frame(sp.obj)). |
cex.lab |
character size of label |
pch |
16 by default, symbol for selected points |
col |
c("grey","lightblue3") by default, color of the two density curves |
xlab |
a list of title for the two x-axis graphics |
ylab |
a list of title for the two y-axis graphics |
axes |
a boolean with TRUE for drawing axes on the map |
lablong |
name of the x-axis that will be printed on the map |
lablat |
name of the y-axis that will be printed on the map |
The user can choose an interval on the density curve by mouse clicking on the lower and upper boundaries of the interval or by giving directly these values. The selected sites are then represented on the map in red. A selection by ‘points’ or ‘polygon’ on the map results in the drawing of the density of the corresponding sub-distribution on the density plot. Finally, the user can modify the bandwith parameter with a cursor in the tk window (parameter alpha). alpha is the smoothing parameter for the kernel smooth : it represents the mean percentage of sample points involved in the local averaging (example : alpha=20 means that on average, n x 0.2 points are in any interval of length 2h where h is the usual bandwidth).
In the case where user click on 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.
Thomas-Agnan C., Aragon Y., Ruiz-Gazen A., Laurent T., Robidou L.
Thibault Laurent, Anne Ruiz-Gazen, Christine Thomas-Agnan (2012), GeoXp: An R Package for Exploratory Spatial Data Analysis. Journal of Statistical Software, 47(2), 1-23.
Roger S.Bivand, Edzer J.Pebesma, Virgilio Gomez-Rubio (2009), Applied Spatial Data Analysis with R, Springer.
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | #########
# data auckland
data(auckland)
# creation of a Spatial object
auckland.sp = SpatialPoints(cbind(auckland$Easting,auckland$Northing))
# ... and then by integrating other variables to create SpatialPointsDataFrame
auckland.spdf = SpatialPointsDataFrame(auckland.sp, auckland)
# 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
contours.auckland<-polylist2list(auckpolys)
dbledensitymap(auckland.spdf, c("Deaths.1977.85","Under.5.1981"),carte=contours.auckland,
xlab=c("Deaths.1977.85","Under.5.1981"),
criteria=(auckland$Deaths.1977.85>mean(auckland$Deaths.1977.85)))
######
# data eire
require("maptools")
eire <- readShapePoly(system.file("etc/shapes/eire.shp", package="spdep")[1],
ID="names", proj4string=CRS("+proj=utm +zone=30 +units=km"))
dbledensitymap(eire,c("A","towns"),kernel="normal",
xlab=c("Individuals rate of blood type A",
"Surface urbaine"),identify=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.