x <- as_draws_df(example_draws())
# random weights for justr for demonstration
w <- runif(ndraws(x), 0, 10)
# use default stratified sampling
x_rs <- resample_draws(x, weights = w)
summarise_draws(x_rs, default_summary_measures())
# use simple random sampling
x_rs <- resample_draws(x, weights = w, method = "simple")
summarise_draws(x_rs, default_summary_measures())
Run the code above in your browser using DataLab