mean_sd {datawizard}R Documentation

Summary Helpers

Description

Summary Helpers

Usage

mean_sd(x, times = 1L, na.rm = TRUE, named = TRUE, ...)

median_mad(x, times = 1L, na.rm = TRUE, constant = 1.4826, named = TRUE, ...)

Arguments

x

A numeric vector (or one that can be coerced to one via as.numeric()) to be summarized.

times

How many SDs above and below the Mean (or MADs around the Median)

na.rm

if TRUE then NA values are stripped from x before computation takes place.

named

Should the vector be named? (E.g., c("-SD" = -1, Mean = 1, "+SD" = 2).)

...

Not used.

constant

scale factor.

Value

A (possibly named) numeric vector of length 2*times + 1 of SDs below the mean, the mean, and SDs above the mean (or median and MAD).

Examples

mean_sd(mtcars$mpg)

mean_sd(mtcars$mpg, times = 2L)

median_mad(mtcars$mpg)


[Package datawizard version 0.7.1 Index]