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 class 'numeric,missing'
n_mean_var(x, w = NULL, na.rm = FALSE, unwgt.var = TRUE)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Arguments

x

a vector of values

w

an optional vector of numeric weights or a vector convertible with numeric with `as.double()`.

na.rm

passed to sum

unwgt.var

Use unweighted or weighted covariance matrix

Value

a list containing mean and var