Description Usage Arguments See Also Examples
Central tendency measures
1 2 3 4 5 6 7 8 9 |
x |
numeric vector |
na.rm |
remove |
single |
return a single value (for |
... |
send further arguments to underlying function, e.g. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | xx <- c(1, 3, 4, 5, 7, 8, 9, 9, 7, 5, 4, 5, 3, 8)
median(xx)
pseudomedian(xx)
# Discrete mode
dmode(c(2, 3, 3, 4, 5))
dmode(c(2, 3, 3, 2, 5))
dmode(c(2, 3, 3, 2, 5), single=FALSE)
dmode(c(2, 1, 3, NA, 1))
dmode(c(2, 1, 3, NA, NA))
# Continuous mode
cmode(c(2, 3, 3, 4, 5))
cmode(c(2, 3, 3, 4, 5))
cmode(c(2, 3, 3, 4, 4, 5), n=512)
cmode(c(2, 2, 3, 3, 6, 6, 6, 7), single=FALSE, adjust=0.5)
# Slightly robust mean
set.seed(1)
r <- round(rexp(12)*c(-100, 100))
mean(r)
srmean(r)
weighted.mean(sort(r), c(0.5, rep(1, length(r)-2), 0.5))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.