Weighted Mean Direction
Returns the weighetd mean direction of a vector of circular data.
## S3 method for class 'circular' weighted.mean(x, w, na.rm=FALSE, control.circular=list(), ...)
x |
a vector. The object is coerced to class
|
w |
a numerical vector of weights the same length as |
na.rm |
logical, indicating if |
control.circular |
the attribute of the resulting object. |
... |
further arguments passed to or from other methods. |
If w
is missing then all elements of x
are given the same
weight, otherwise the weights coerced to numeric by as.numeric
and normalized to sum to one.
Missing values in w
are not handled specially and so give a
missing value as the result. However, zero weights are handled
specially and the corresponding x
values are omitted from the
computation.
Returns the weighted mean direction of the data as an object of class circular
with the attribute given by control.circular
or from x
if missed in control.circular
.
Claudio Agostinelli
# Compute the weighted mean direction of a random sample of observations. x <- circular(runif(50, circular(0), pi)) w <- runif(50, 0, 1) weighted.mean(x, w)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.