histobarmap {GeoXp}R Documentation

Histogram, barplot and map

Description

The function histobarmap() draws a bar plot (vertical bar) of the given variable var1, a histogram of the given variable var2 and a map with sites of coordinates (long,lat).

Usage

histobarmap(long,lat,var1,var2,criteria=NULL,carte=NULL, label = "",cex.lab=1,
pch = 16, col= "grey", nbcol = 10,names.arg="", xlab=c("",""), ylab=c("",""),
listvar=NULL, listnomvar=NULL, axes=FALSE,lablong="", lablat="")

Arguments

long a vector x of size n
lat a vector y of size n
var1 a vector of factor of size n
var2 a vector of numerical values of size n
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 "grey" by default, color of bars on the histogram
nbcol number of cells for histogram (10 by default)
names.arg names of factors of var1
xlab a list of title for the two x-axis graphics
ylab a list of title for the two y-axis graphics
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
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

Each site is associated to a factor of var1 and to a value of var2. There is interactivity between the three windows created : the sites selected by a bar on the bar plot or on the histogram are represented on the map in red and the value and factor of sites selected on the map are represented in red on the bar plot and 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

dblehistomap, histobarmap, scattermap, dbledensitymap

Examples

# Data Colombus
example(columbus)
coords <- coordinates(columbus)
cont<-spdf2list(columbus)$poly
obs<-histobarmap(coords[,1], coords[,2],columbus@data$CP,
columbus@data$HOVAL,label=columbus@data$NEIGNO, carte=cont,
listvar=columbus@data,listnomvar=names(columbus@data),col=colors()[100:101],
xlab=c("CP","Hoval"),ylab=c("Count","Count"),names.arg=c("A","B"),pch=2)

# Data eire
data(eire)
eire.contours<-polylist2list(eire.polys.utm)
histobarmap(eire.coords.utm$V1,eire.coords.utm$V2,eire.df$pale,eire.df$A,carte=eire.contours,
listvar=eire.df,listnomvar=names(eire.df),xlab=c("Appartenance à
la région du Pale","Taux moyen de groupe sanguin A"),names.arg=c("Hors Pale","Pale"),
col=colors()[101:102],label=as.character(1:26),cex.lab=0.7,pch=c(3,7))

[Package GeoXp version 1.4 Index]