powered by
Use means, medians, or modes to summarise the distribution of random draws in an rvec.
draws_median(x, na_rm = FALSE)# S3 method for rvec_chr draws_median(x, na_rm = FALSE)# S3 method for rvec draws_median(x, na_rm = FALSE)draws_mean(x, na_rm = FALSE)# S3 method for rvec draws_mean(x, na_rm = FALSE)# S3 method for rvec_chr draws_mean(x, na_rm = FALSE)draws_mode(x, na_rm = FALSE)# S3 method for rvec draws_mode(x, na_rm = FALSE)
# S3 method for rvec_chr draws_median(x, na_rm = FALSE)
# S3 method for rvec draws_median(x, na_rm = FALSE)
draws_mean(x, na_rm = FALSE)
# S3 method for rvec draws_mean(x, na_rm = FALSE)
# S3 method for rvec_chr draws_mean(x, na_rm = FALSE)
draws_mode(x, na_rm = FALSE)
# S3 method for rvec draws_mode(x, na_rm = FALSE)
A vector.
An object of class rvec.
Whether to remove NAs before calculating summaries. Default is FALSE.
FALSE
When method is "mode", reduce_rvec() returns the most common value for each observation. When there is a tie, it returns NA.
method
"mode"
reduce_rvec()
NA
Apply pre-specified functions across draws:
draws_all()
draws_any()
draws_min()
draws_max()
draws_sd()
draws_var()
draws_cv()
draws_ci()
draws_quantile()
Apply arbitrary function across draws:
draws_fun()
m <- rbind(a = c(1, 1, 1, 2, 3), b = c(2, 4, 0, 2, 3), c = c(0, 0, 1, 0, 100)) x <- rvec(m) x draws_median(x) draws_mean(x) draws_mode(x)
Run the code above in your browser using DataLab