Description Usage Arguments Details Value Author(s) References See Also Examples
The function dblehistomap
draws two histograms of the given variables names.var[1]
and
names.var[2]
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 there is interactivity between the two
windows created.
1 2 3 4 |
sp.obj |
object of class extending Spatial-class |
names.var |
a vector of 2 characters; attribute name or column number in attribute table |
nbcol |
a vector of integer indicating number of cells for histogram 1 and histogram 2 (10 for each by default) |
type |
Character string indicating type of histogram to be drawn. "percent" and "count" give relative frequency and frequency histograms, "density" produces a density scale histogram. |
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 |
a vector of character indicating colors for the bars on the histogram 1 and histogram 2 |
xlab |
a vector of character containing titles for the two graphics x-axis |
ylab |
a vector of character containing titles for the two graphics y-axis |
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 selection of sites by ‘points’ or ‘polygons’ on the map results in the drawing of the red histograms of the subdistributions corresponding to this subset of sites.
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.
dblehistomap
, 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 29 30 31 | ######
# 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
require("maptools")
midiP <- readShapePoly(system.file("shapes/region.shp", package="GeoXp")[1])
cont_midiP<-spdf2list(midiP[-c(22,23),])$poly
# A basic call of dblehistomap function
dblehistomap(immob.spdf,c("prix.vente","prix.location"),
carte= cont_midiP, identify=TRUE, cex.lab=0.6)
###
# data colombus
x <- readShapePoly(system.file("shapes/columbus.shp", package="maptools")[1])
# example of use with many options
dblehistomap(x,c("HOVAL","CRIME"), nbcol=c(5,10),type="percent",
xlab=c("hoval","crime"),identify=TRUE, cex.lab=0.7, ylab=c("percent","percent"),
col=c("pink","orange"),pch=14,axes=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.