Learn R Programming

GeoXp (version 1.6.2)

angleplotmap: 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 $vector(s_is_j)$ and the x-axis.

Usage

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

Arguments

sp.obj
object of class extending Spatial-class
name.var
a character; attribute name or column number in attribute table
quantiles
a boolean to represent the Additive Quantile Regression Smoothing
names.attr
a vector of character: names to use in panel (if different from the names of variable used in sp.obj)
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 FALSE, identify plotted objects (currently only working for points plots). Labels for identification are the row.names of the attribute table row.names(as.data.frame(sp.obj)).
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

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.

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 $vector(s_is_j)$ and the x-axis. Possibility to represent a smoothing spline regression quantile $g_alpha$. For $0g_{max(\alpha)}(\theta{ij})$$ are represented.

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

Run this code
######
# data Conflicts Africa
data(afcon)

# 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 ...
afcon.sp = SpatialPoints(cbind(afcon$x,afcon$y))
# ... and then by integrating other variables to create SpatialPointsDataFrame
afcon.spdf = SpatialPointsDataFrame(afcon.sp, afcon)
# For more details, see vignette('sp', package="sp")

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

# A basic call of histomap function
angleplotmap(afcon.spdf,"totcon", carte= africa.contour,
identify=TRUE, cex.lab=0.6)


#####
# Data Meuse
data(meuse)

# meuse is a data.frame object. We have to create
# a Spatial object, by using first the longitude and latitude
# to create Spatial Points object ...
meuse.sp = SpatialPoints(cbind(meuse$x,meuse$y))
# ... and then by integrating other variables to create SpatialPointsDataFrame
meuse.spdf = SpatialPointsDataFrame(meuse.sp, meuse)

# meuse.riv is used for contour plot
data(meuse.riv)

angleplotmap(meuse.spdf,"copper",
col="green",quantiles=TRUE, cex.lab=0.7,
xlab="Concentration in plomb (in ppm)",pch=7,carte=meuse.riv[c(21:65,110:153),])

Run the code above in your browser using DataLab