boxplotmap | R Documentation |
The function boxplotmap()
draws a boxplot of the given variable name.var
and a map with site of coordinates sf.obj
.
boxplotmap(sf.obj, name.var, criteria = NULL, carte = NULL,
identify = NULL, cex.lab = 0.8, pch = 16, col = "lightblue3",
xlab = "", ylab = "", axes = FALSE, lablong = "", lablat = "")
sf.obj |
object of class sf |
name.var |
a character; attribute name or column number in attribute table |
criteria |
a vector of boolean of size the number of spatial sites, 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 NULL, the name of the variable for identifying observations on the map |
cex.lab |
character size of label |
pch |
16 by default, symbol for selected points |
col |
"lightblue3" by default, color of bars on the boxplot |
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 |
There is an interactivity only in one direction : the sites selected by interquartile on the boxplot are represented on the map in red.
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.
Roger S.Bivand, Edzer J.Pebesma, Virgilio Gomez-Rubio (2009), Applied Spatial Data Analysis with R, Springer.
histomap
, histobarmap
, scattermap
, densitymap
######
# data columbus
require("sf")
columbus <- st_read(system.file("shapes/columbus.shp", package="spData")[1])
# a basic use of boxplotmap
boxplotmap(columbus, "CRIME", criteria = (columbus@data$CP == 1),
xlab = "Crime", ylab = "Percent", identify = TRUE, cex.lab = 0.7)
## Not run:
# data boston
require(sf)
boston <- st_read(system.file("shapes/boston_tracts.shp", package="spData")[1])
# a simple use of boxplotmap
boxplotmap(boston, "MEDV", criteria = (boston$CHAS == 1))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.