dispersion {tectonicr} | R Documentation |
Circular distance and dispersion
Description
Circular distance between two angles and circular dispersion of angles about a specified angle.
Usage
circular_distance(x, y, axial = TRUE, na.rm = TRUE)
circular_dispersion(
x,
y = NULL,
w = NULL,
w.y = NULL,
norm = FALSE,
axial = TRUE,
na.rm = TRUE
)
Arguments
x , y |
vectors of numeric values in degrees. |
axial |
logical. Whether the data are axial, i.e. pi-periodical
( |
na.rm |
logical. Whether |
w , w.y |
(optional) Weights. A vector of positive numbers and of the same
length as |
norm |
logical. Whether the dispersion should be normalized by the maximum possible angular difference. |
Value
circular_distance
returns a numeric vector of positive numbers,
circular_dispersion
returns a positive number.
Note
If from
is NULL
, than the circular variance is returned.
References
Mardia, K.V. (1972). Statistics of Directional Data: Probability and Mathematical Statistics. London: Academic Press.
See Also
circular_mean()
, circular_var()
.
Examples
a <- c(0, 2, 359, 6, 354)
circular_distance(a, 10) # distance to single value
b <- a + 90
circular_distance(a, b) # distance to multiple values
data("nuvel1")
PoR <- subset(nuvel1, nuvel1$plate.rot == "na")
sa.por <- PoR_shmax(san_andreas, PoR, "right")
circular_dispersion(sa.por$azi.PoR, y = 135)
circular_dispersion(sa.por$azi.PoR, y = 135, w = 1 / san_andreas$unc)