Skip to contents

Apply all or any logical summaries across random draws.

Usage

draws_all(x, na_rm = FALSE)

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

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

draws_any(x, na_rm = FALSE)

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

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

Arguments

x

An object of class rvec.

na_rm

Whether to remove NAs before calculating summaries. 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(TRUE,  FALSE,  TRUE),
           b = c(TRUE,  TRUE,   TRUE),
           c = c(FALSE, FALSE,  FALSE))
x <- rvec(m)
x
#> <rvec_lgl<3>[3]>
#>     a     b     c 
#> T,F,T T,T,T F,F,F 
draws_all(x)
#>     a     b     c 
#> FALSE  TRUE FALSE 
draws_any(x)
#>     a     b     c 
#>  TRUE  TRUE FALSE