draws_sd: Standard Deviations, Variances, and Coefficients of Variation...

View source: R/draws.R

draws_sdR Documentation

Standard Deviations, Variances, and Coefficients of Variation Across Random Draws

Description

Use standard deviations, variances, or coefficients of variation to summarise the distribution of random draws in an rvec.

Usage

draws_sd(x, na_rm = FALSE)

## S3 method for class 'rvec_chr'
draws_sd(x, na_rm = FALSE)

## S3 method for class 'rvec'
draws_sd(x, na_rm = FALSE)

draws_var(x, na_rm = FALSE)

## S3 method for class 'rvec_chr'
draws_var(x, na_rm = FALSE)

## S3 method for class 'rvec'
draws_var(x, na_rm = FALSE)

draws_cv(x, na_rm = FALSE)

## S3 method for class 'rvec_chr'
draws_cv(x, na_rm = FALSE)

## S3 method for class 'rvec'
draws_cv(x, na_rm = FALSE)

Arguments

x

An object of class rvec.

na_rm

Whether to remove NAs before calculating summaries. Default is FALSE.

Details

The coefficient of variation is the standard deviation divided by the mean.

Value

A vector.

See Also

Apply pre-specified functions across draws:

  • draws_all()

  • draws_any()

  • draws_mean()

  • draws_median()

  • draws_mode()

  • draws_min()

  • draws_max()

  • draws_ci()

  • draws_quantile()

Apply arbitrary function across draws:

  • draws_fun()

Examples

m <- rbind(a = c(1, 1, 1, 2, 3),
           b = c(2, 4, 0, 2, 3),
           c = c(0, 0, 1, 0, 100))
x <- rvec(m)
x
draws_sd(x)
draws_var(x)
draws_cv(x)

rvec documentation built on Dec. 10, 2025, 5:08 p.m.