Skip to contents

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
#> <rvec_dbl<3>[3]>
#>           a           b           c 
#>      1,-3,2  Inf,0,-Inf 0.2,0.3,0.1 
draws_min(x)
#>    a    b    c 
#> -3.0 -Inf  0.1 
draws_max(x)
#>   a   b   c 
#> 2.0 Inf 0.3