draws_min {rvec}R Documentation

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 class 'rvec_chr'
draws_min(x, na_rm = FALSE)

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

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

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

Arguments

x

An object of class rvec.

na_rm

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

Value

A vector.

See Also

Apply pre-specified functions across draws:

Apply arbitrary function across draws:

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

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)

[Package rvec version 0.0.7 Index]