histobarmap()
draws a bar plot (vertical bar) of the given variable
names.var[1]
, a histogram of the given variable names.var[2]
and a map with
sites of coordinates coordinates(sp.obj)
.histobarmap(sp.obj, names.var, nbcol = 10, type = "count",
names.arg = "", names.attr=names(sp.obj), criteria=NULL, carte=NULL, identify=FALSE,
cex.lab=0.8, pch=16, col="lightblue3", xlab=c("barplot","histogram"), ylab=rep("count",2),
axes=FALSE, lablong="", lablat="")
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.
names.var[1]
and to a value of
names.var[2]
. 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.
Roger S.Bivand, Edzer J.Pebesma, Virgilio Gomez-Rubio (2009), Applied Spatial Data Analysis with R, Springer.
dblehistomap
, histobarmap
, scattermap
, dbledensitymap
###
# Data Colombus
require("maptools")
example(columbus)
# an example of use
histobarmap(columbus,c("CP","HOVAL"),nbcol=8, type="percent",
names.arg=c("A","B"), xlab=c("CP","Hoval"), ylab=rep("percent",2))
######
# data eire
eire <- readShapePoly(system.file("etc/shapes/eire.shp", package="spdep")[1],
ID="names", proj4string=CRS("+proj=utm +zone=30 +units=km"))
# example of use
histobarmap(eire, c("pale","A"),names.arg=c("Ouside Pale","Pale"),
xlab=c("Appartenance to the region of Pale","Average number of people with blood A"),
col=colors()[101:102],identify=TRUE)
Run the code above in your browser using DataLab