Learn R Programming

rvec (version 0.0.7)

draws_min: Minima and Maxima Across Random Draws

Description

Apply min or max across random draws.

Usage

draws_min(x, na_rm = FALSE)

draws_max(x, na_rm = FALSE)

# S3 method for rvec_chr draws_min(x, na_rm = FALSE)

# S3 method for rvec draws_min(x, na_rm = FALSE)

# S3 method for rvec_chr draws_max(x, na_rm = FALSE)

# S3 method for rvec draws_max(x, na_rm = FALSE)

Value

A vector.

Arguments

x

An object of class rvec.

na_rm

Whether to remove NAs before calculating minima and maxima. Default is FALSE.

See Also

Apply pre-specified functions across draws:

  • draws_all()

  • draws_any()

  • draws_median()

  • draws_mean()

  • draws_mode()

  • draws_ci()

  • draws_quantile()

Apply arbitrary function across draws:

  • draws_fun()

For additional functions for summarising random draws, see tidybayes and ggdist. Function as_list_col() converts rvecs into a format that tidybayes and ggdist can work with.

Examples

Run this code
m <- rbind(a = c(1,  -3,  2),
           b = c(Inf,  0,   -Inf),
           c = c(0.2, 0.3,  0.1))
x <- rvec(m)
x
draws_min(x)
draws_max(x)

Run the code above in your browser using DataLab