polyboxplotmap: Interactive polyboxplot and map

View source: R/polyboxplotmap.R

polyboxplotmapR Documentation

Interactive polyboxplot and map

Description

Parallel Boxplots of a numerical variable by levels of a factor. It interacts with a map.

Usage

polyboxplotmap(sf.obj, names.var, varwidth = FALSE, names.arg = "",
  criteria = NULL, carte = NULL, identify = NULL, 
  cex.lab = 0.8, pch = 16, col = "lightblue3", xlab = "", ylab = "count", 
  axes = FALSE, lablong = "", lablat = "")

Arguments

sf.obj

object of class sf

names.var

a vector of 2 characters; first character corresponds to the name of a factor/character and second character corresponds to a numeric value

varwidth

if varwidth is TRUE, the boxes are drawn with widths proportional to the square-roots of the number of observations in the groups

names.arg

a vector of level names (for factor)

criteria

a vector of boolean of size the number of Spatial units, 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

a vector of symbol which must be equal to the number of group else all sites are printed in pch[1]

col

a vector of colors which must be equal to the number of group else all sites and all box are printed in col[1]

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

Each site is associated to a value of a level of names.var[1] and of a value of names.var[2]. There is an interactivity only in one direction : the sites selected by quartile-intervals on one of the boxplots are then represented on the map in red (or colors according to the options).

Value

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.

Author(s)

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

References

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.

See Also

dblehistomap, histobarmap, scattermap, dbledensitymap

Examples

######
# data eire
require(sf)
eire <- st_read(system.file("shapes/eire.shp", package="spData")[1])

# example of use of polyboxplotmap
polyboxplotmap(eire, c("pale", "POPCHG"), names.arg = c("Outside Pale", "Pale"), 
  xlab = "Appartenance to the region of Pale", col = c("pink", "violet"))

tibo31/GeoXp documentation built on April 8, 2023, 7:50 a.m.