Description Usage Arguments Value Examples
View source: R/heading-density.R
Computes an approximate density useful for visualization. For proper
circular densities, use hdg_circular()
and circular::density.circular()
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | hdg_density(
hdg,
bw = 5,
kernel = c("gaussian", "epanechnikov", "rectangular", "triangular", "biweight",
"cosine", "optcosine"),
weights = NULL,
n = 512,
na.rm = FALSE,
...
)
## S3 method for class 'hdg_density'
plot(x, main = NULL, xlab = NULL, ylab = NULL, axes = TRUE, ...)
hdg_plot(
hdg,
density = hdg_density(hdg, na.rm = TRUE),
main = NULL,
xlab = NULL,
ylab = NULL,
axes = TRUE,
...
)
|
hdg |
A heading in degrees, where 0 is north,
90 is east, 180 is south, and 270 is west. Values
outside the range [0-360) are coerced to this range
using |
bw |
The bandwidth of the smoothing kernel. Automatic methods are not available, so you will have to set this value manually to obtain the smoothness you want. |
kernel |
a character string giving the smoothing kernel
to be used. This must partially match one of
|
weights |
numeric vector of non-negative observation weights,
hence of same length as |
n |
the number of equally spaced points at which the density is
to be estimated. When |
na.rm |
logical; if |
... |
For |
x |
the data from which the estimate is to be computed. For the default method a numeric vector: long vectors are not supported. |
main, xlab, ylab, axes |
See |
density |
A |
An object identical to stats::density()
but with class
"hdg_density".
1 2 3 4 | x <- head(kamloops2016$wind_dir, 1000)
hdg_density(x, na.rm = TRUE)
plot(hdg_density(x, na.rm = TRUE))
hdg_plot(x)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.