histomap {GeoXp}R Documentation

Interactive Histogram and map

Description

The function histomap() draws a histogram of the given variable var and a map with sites of coordinates (long,lat). Each site is associated to a value of var and there is interactivity between the two windows.

Usage

histomap(long,lat,var,nbcol=10, listvar=NULL, listnomvar=NULL, criteria=NULL,
carte=NULL, label="",cex.lab=1, pch=16, col="blue", xlab="",ylab="",axes=FALSE,
lablong="",lablat="")

Arguments

long a vector x of size n
lat a vector y of size n
var a vector of numeric values of size n
nbcol number of cells for histogram (10 by default)
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
criteria a vector of size n of boolean 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
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
pch 16 by default, symbol for selected points
col "blue" by default, color of bars on the histogram
xlab a title for the graphic x-axis
ylab a title for the graphic 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

Details

Sites selected by a bar on the histogram are represented on the map in red and the values of sites selected on the map by `points' or `polygon' are represented in red as a sub-histogram on the histogram.

Value

A vector of boolean of size n. TRUE if the site was in the last selection.

Author(s)

Thomas-Agnan C., Aragon Y., Ruiz-Gazen A., Laurent T., Robidou L.

References

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

See Also

histomap, histobarmap, scattermap, densitymap

Examples

# 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
histomap(immob$longitude,immob$latitude,immob$prix.vente,
carte= cont_midiP,listvar=immob, col='grey',
listnomvar=names(immob),label=immob$Nom,cex.lab=0.6)

# data oldcol
example(columbus)
coords <- coordinates(columbus)
cont<-spdf2list(columbus)$poly

histomap(coords[,1], coords[,2],columbus@data$CRIME,listvar=columbus@data, 
listnomvar=names(columbus@data),criteria=(columbus@data$CRIME>mean(columbus@data$CRIME)),
carte=cont,col="grey")

# data afcon
data(afcon)
africa <- readShapePoly(system.file("shapes/Africa.shp", package = "GeoXp")[1])
africa.contour<-spdf2list(africa)$poly
histomap(afcon$x,afcon$y,afcon$totcon,listvar=afcon,
listnomvar=names(afcon),criteria=(afcon$totcon>mean(afcon$totcon)),
label=afcon$name,cex.lab=0.6,pch=14,carte=africa.contour)

# data eire
data(eire)
eire.contours<-polylist2list(eire.polys.utm)

histomap(eire.coords.utm$V1,eire.coords.utm$V2,eire.df$A,carte=eire.contours,listvar=eire.df,
listnomvar=names(eire.df),xlab="Taux d'individus au groupe sanguin A",pch=5)


[Package GeoXp version 1.4 Index]