angleplotmap: Detection of an eventual directional trend

View source: R/angleplotmap.R

angleplotmapR Documentation

Detection of an eventual directional trend

Description

The function angleplotmap() is used to detect an eventual directional trend associated to variable name.var. It represents the absolute difference between the value of name.var at two sites as a function of the angle between vector \overrightarrow{s_is_j} and the x-axis.

Usage

angleplotmap(sf.obj, name.var, quantiles = TRUE, 
  criteria = NULL, carte = NULL, identify = NULL, cex.lab = 0.8, pch = 16, 
  col = "lightblue3", xlab = "angle", ylab = "absolute magnitude", axes = FALSE,
  lablong = "", lablat = "")

Arguments

sf.obj

object of class sf

name.var

a character; attribute name or column number in attribute table

quantiles

a boolean to represent the Additive Quantile Regression Smoothing

criteria

a vector of boolean which permit to represent preselected sites with a cross, using the tcltk window (must be equal to the number of spatial units)

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 cloud map

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

For each couple of sites (s_i,s_j), the graphic represents on the y-axis the absolute difference between var_i and var_j :

D_{ij}=|var_i-var_j|


and on the x-axis the angle \theta_{ij} between \overrightarrow{s_is_j} and the x-axis. Possibility to represent a smoothing spline regression quantile g_\alpha. For 0<\alpha<1,

Pr[D_{ij}<g_\alpha(\theta{ij})]=\alpha

If that case, only the pair of sites (s_i,s_j) verifying :

D_{ij}>g_{max(\alpha)}(\theta{ij})

are represented.

Value

In the case where user click on save results button, a matrix of integer is created as a global variable in last.select object. It corresponds to the numbers of spatial unit corresponding to couple of sites selected just before leaving the Tk window.

Author(s)

Thomas-Agnan Christine, Aragon Yves, Ruiz-Gazen Anne, Laurent Thibault, Robidou Lauriane

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.

Roger S.Bivand, Edzer J.Pebesma, Virgilio Gomez-Rubio (2009), Applied Spatial Data Analysis with R, Springer.

See Also

variocloudmap, driftmap

Examples

######
# data Conflicts Africa
if (require(spData, quietly = TRUE)) {
 data(afcon, package = "spData")
}
# afcon is a data.frame object. We have to create
# a Spatial object, by using first the longitude and latitude
# to create Spatial Points object ...
require(sf)
afcon.sf <- st_as_sf(afcon, coords = c("x", "y"), crs = 4326)

# optional : we add some contours that don't correspond to the spatial unit
# but are nice for mapping
africa <- st_read(system.file("shapes/Africa.shp", package = "GeoXp")[1])

# A basic call of histomap function
angleplotmap(afcon.sf, "totcon", carte = africa,
  identify = "name", cex.lab = 0.6)
 
## Not run:  
if (require(sp, quietly = TRUE)) {
 data(meuse, package = "sp")
 meuse_sf <- sf::st_as_sf(meuse, coords = c("x", "y"), crs = 28992, agr = "constant")
 data(meuse.riv, package = "sp")
 meuse.sr <- sf::st_as_sf(SpatialPolygons(list(Polygons(list(Polygon(meuse.riv)), "meuse.riv"))),
     crs = 28992)
}

angleplotmap(meuse_sf, "copper", col = "green", quantiles = TRUE, 
  cex.lab = 0.7, xlab = "Concentration in plomb (in ppm)", pch = 7, 
  carte = meuse.sr)

## End(Not run)

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