Learn R Programming

rvec (version 0.0.7)

draws_all: Logical Operations Across Random Draws

Description

Apply all or any logical summaries across random draws.

Usage

draws_all(x, na_rm = FALSE)

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

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

draws_any(x, na_rm = FALSE)

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

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

Value

A vector.

Arguments

x

An object of class rvec.

na_rm

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

See Also

Apply pre-specified functions across draws:

  • draws_min()

  • draws_max()

  • 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(TRUE,  FALSE,  TRUE),
           b = c(TRUE,  TRUE,   TRUE),
           c = c(FALSE, FALSE,  FALSE))
x <- rvec(m)
x
draws_all(x)
draws_any(x)

Run the code above in your browser using DataLab