dblehistomap {GeoXp} | R Documentation |
The function dblehistomap()
draws two histograms of the given variables var1
and var2
and a map with sites of coordinates (long
,lat
). Each site is associated to a value of var1
and var2
and there is interactivity between the two windows created.
dblehistomap(long, lat, var1, var2,listvar=NULL, listnomvar=NULL, nbcol=c(10,10), carte = NULL,criteria=NULL, pch = 16, col=c("grey","blue"), xlab = c("",""), ylab=c("count","count"), label = "",cex.lab=1,axes=FALSE, lablong="", lablat="")
long |
a vector x of size n |
lat |
a vector y of size n |
var1 |
a vector of numeric values of size n |
var2 |
a vector of numeric values of size n |
listvar |
matrix of variables which permit to plot bubbles on map or add a graphic using the tk window |
listnomvar |
a list with names of variables listvar |
nbcol |
a list of number of cells for histogram 1 and histogram 2 (10 by default) |
carte |
matrix with 2 columns for drawing spatial polygonal contours : x and y coordinates of the vertices of the polygon |
criteria |
a vector of size n of boolean which permit to represent preselected sites with a cross, using the tcltk window |
pch |
16 by default, symbol for selected points |
col |
a list of colors for the bars on the histogram 1 and histogram 2 |
xlab |
a list of title for the two x-axis graphics |
ylab |
a list of title for the two y-axis graphics |
label |
a list of character of size n with name of site. Names are printed on map after a selection |
cex.lab |
character size of label |
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.
A vector of boolean of size n. TRUE if the site was in the last selection.
Thomas-Agnan C., Aragon Y., Ruiz-Gazen A., Laurent T., Robidou L.
Aragon Yves, Perrin Olivier, Ruiz-Gazen Anne, Thomas-Agnan Christine (2009), Statistique et Econométrie pour données géoréférencées : modèles et études de cas
dblehistomap
, histobarmap
, scattermap
, densitymap
# data on price indices of real estate in France data(immob) midiP <- readShapePoly(system.file("shapes/region.shp", package="GeoXp")[1]) cont_midiP<-spdf2list(midiP)$poly dblehistomap(immob$longitude,immob$latitude,immob$prix.vente, immob$prix.location,carte= cont_midiP,listvar=immob, listnomvar=names(immob),label=immob$Nom,cex.lab=0.7,xlab=c("vente","location"), col=colors()[99:100]) # data auckland data(auckland) contours.auckland<-polylist2list(auckpolys) dblehistomap(auckland$Easting,auckland$Northing,var1=auckland$Deaths.1977.85, var2=auckland$Under.5.1981,carte=contours.auckland, listvar=cbind(auckland,as.numeric(auckland$Deaths.1977.85> mean(auckland$Deaths.1977.85))),listnomvar=c(names(auckland),"sup to mean"), xlab=c("Deaths.1977.85","Under.5.1981"), criteria=(auckland$Deaths.1977.85>mean(auckland$Deaths.1977.85))) # data colombus x <- readShapePoly(system.file("shapes/columbus.shp", package="maptools")[1]) colombus.contours<-spdf2list(x)$poly coords <- coordinates(x) colombus<-x@data dblehistomap(coords[,1],coords[,2], colombus$HOVAL,colombus$CRIME,xlab=c("hoval","crime"), label=colombus$NEIGNO, cex.lab=0.7, carte=colombus.contours, listvar=colombus,listnomvar=names(colombus))