bmstdr_variogram {bmstdr} | R Documentation |
Calculates and plots the variogram cloud and an estimated variogram.
Description
Calculates and plots the variogram cloud and an estimated variogram.
Usage
bmstdr_variogram(
formula = yo3 ~ utmx + utmy,
coordtype = "utm",
data = nyspatial,
nbins = 30
)
Arguments
formula |
Its a formula argument for the response and the coordinates. |
coordtype |
Type of coordinates: utm, lonlat or plain with utm (supplied in meters) as the default. Distance will be calculated in units of kilometer if this argument is either utm or lonlat. Euclidean distance will be calculated if this is given as the third type plain. If distance in meter is to be calculated then coordtype should be passed on as plain although the coords are supplied in UTM. |
data |
A data frame containing the response and the co-ordinates |
nbins |
Number of bins for the variogram. Default is 30. |
Value
A list containing:
cloud - A data frame containing the variogram cloud. This contains pairs of all the data locations, distance between the locations and the variogram value for the pair.
variogram A data frame containing the variogram values in each bin.
cloudplot A ggplot2 object of the plot of the variogram cloud.
variogramplot A ggplot2 object of the plot of the binned variogram values.
Examples
a <- bmstdr_variogram(data=nyspatial, formula = yo3~utmx + utmy,
coordtype="utm", nb=50)
names(a)
if (require(ggpubr)) ggarrange(a$cloudplot, a$variogramplot, nrow=1, ncol=2)