Available for numeric, integer, and factor objects. character objects are handled by first converting to a factor.

n_mean_var(x, w = NULL, na.rm = FALSE, unwgt.var = TRUE)

# S4 method for numeric,missing
n_mean_var(x, w = NULL, na.rm = FALSE, unwgt.var = TRUE)

# S4 method for numeric,numeric
n_mean_var(x, w = NULL, na.rm = FALSE, unwgt.var = TRUE)

# S4 method for integer,missing
n_mean_var(x, w = NULL, na.rm = FALSE, unwgt.var = TRUE)

# S4 method for integer,numeric
n_mean_var(x, w = NULL, na.rm = FALSE, unwgt.var = TRUE)

# S4 method for logical,missing
n_mean_var(x, na.rm = FALSE, unwgt.var = TRUE)

# S4 method for logical,numeric
n_mean_var(x, w = NULL, na.rm = FALSE, unwgt.var = TRUE)

# S4 method for factor,missing
n_mean_var(x, w = NULL, na.rm = FALSE, unwgt.var = TRUE)

# S4 method for factor,numeric
n_mean_var(x, w = NULL, na.rm = FALSE, unwgt.var = TRUE)

# S4 method for character,missing
n_mean_var(x, w = NULL, na.rm = FALSE, unwgt.var = TRUE)

# S4 method for character,numeric
n_mean_var(x, w = NULL, na.rm = TRUE, unwgt.var = TRUE)

Arguments

x

a vector of values

w

an optional vector of numeric weights

na.rm

passed to sum

unwgt.var

Use unweighted or weighted covariance matrix

Value

a list containing mean and var