View source: R/variocloudmap.R
variocloudmap | R Documentation |
The function variocloudmap()
draws a semi-variocloud (directional or omnidirectional) and a map.
It is used to detect spatial autocorrelation. Possibility to draw the empirical semi-variogram
and a robust empirical semi-variogram.
variocloudmap(sf.obj, name.var, bin = NULL, quantiles = TRUE,
criteria = NULL, carte = NULL, identify = NULL,
cex.lab = 0.8, pch = 16, col = "lightblue3", xlab = "", ylab = "", axes = FALSE,
lablong = "", lablat = "", xlim = NULL, ylim = NULL)
sf.obj |
object of class sf |
name.var |
a character; attribute name or column number in attribute table |
bin |
a vector of numeric values where empirical variogram will be evaluated |
quantiles |
a boolean to represent the Additive Quantile Regression Smoothing |
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 |
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 |
xlim |
the x limits of the plot |
ylim |
the y limits of the plot |
For some couple of sites (s_i,s_j)
, the graph represents on the y-axis the semi squared difference
between var_i
and var_j
:
\gamma_{ij}=\frac{1}{2}(var_i-var_j)^2
and on the x-absis the distance h_{ij}
between s_i
and s_j
.
The semi Empirical variogram has been calculated as :
\gamma(h)=\frac{1}{2|N(h)|}\sum_{N(h)}(Z(s_i)-Z(s_j))^2
where
N(h)=\{(s_i,s_j):s_i-s_j=h;i,j=1,...,n\}
and the robust version :
\gamma(h)=\frac{1}{2(0.457+\frac{0.494}{|N(h)|})}(\frac{1}{|N(h)|}\sum_{N(h)}|Z(s_i)-Z(s_j)|^{1/2})^4
The number N of points to evaluate the empirical variogram and the distance \epsilon
between
points are set as follows :
N=\frac{1}{max(30/n^2,0.08,d/D)}
and :
\epsilon=\frac{D}{N}
with :
D=max(h_{ij})-min(h_{ij})
and :
d=max(h_{ij}^{(l)}-h_{ij}^{(l+1)}),
where h^{(l)}
is the vector of sorted distances.
In options, possibility to represent a regression quantile smoothing spline g_{\alpha}
(in that
case the points below this quantile curve are not drawn).
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.
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.
Cressie N. and Hawkins D. (1980), Robust estimation of the variogram, in Journal of the international association for mathematical geology, 13, 115-125.
angleplotmap
, driftmap
#####
require(sf)
# Data Meuse
if (require(sp, quietly = TRUE)) {
data(meuse, package = "sp")
meuse_sf <- st_as_sf(meuse, coords = c("x", "y"), crs = 28992, agr = "constant")
data(meuse.riv, package = "sp")
meuse.sr <- st_as_sf(SpatialPolygons(list(Polygons(list(Polygon(meuse.riv)),
"meuse.riv"))), crs = 28992)
}
# example of use of variocloudmap
variocloudmap(meuse_sf, "zinc", quantiles = TRUE, bin = seq(0, 2000, 100),
xlim = c(0, 2000), ylim = c(0, 500000), pch = 2, carte = meuse.sr,
criteria = (meuse_sf$lime == 1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.