means_choice | R Documentation |
Computes the means of x
. The list returned has an attribute "mindiff"
which contains
the smallest distance between two mean values before rounding.
If winsor
and/or trim
is set to NA
then the trimmed and/or winsorized means are not computed.
Currently implemented are:
mean
arithmetic mean
median
median
harmonic
harmonic mean
geometric
geometric mean
mode
(first) mode
trim
trimmed mean
winsor
winsorized mean
means_choice(x, digits, na.rm = TRUE, trim = 0.2, winsor = 0.2)
means(x, digits, na.rm = TRUE, trim = 0.2, winsor = 0.2)
x |
numeric: data values |
digits |
numeric: integer indicating the number of decimal points for rounding (negative values are allowed) |
na.rm |
logical: should |
trim |
numeric: the fraction (0 to 0.5) of observations to be trimmed from each end of |
winsor |
numeric: the fraction (0 to 0.5) of observations to be moved from each end of |
A list with mean values.
x <- c(runif(9), 3)
means_choice(x, 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.