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)

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

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

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

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

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

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

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

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

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

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

Arguments

x

a vector of values

w

an optional vector of numeric weights

na.rm

passed to sum

Value

a list containing mean and var