rank_wtd {wdm} | R Documentation |
Computing weighted ranks
Description
The weighted rank of among
with weights
is defined as
Usage
rank_wtd(x, weights = numeric(), ties_method = "average")
Arguments
x |
a numeric vector. |
weights |
a vector of weights (same length as |
ties_method |
Indicates how to treat ties; same as in R, see https://stat.ethz.ch/R-manual/R-devel/library/base/html/rank.html. |
Value
a vector of ranks.
Examples
x <- rnorm(100)
w <- rexp(100)
rank(x)
rank_wtd(x, w)
[Package wdm version 0.2.4 Index]