set.seed(5678)
x = rvar_rng(rnorm, 4, mean = 1:4, sd = 2)
# These will give similar results to mean(1:4),
# median(1:4), sum(1:4), prod(1:4), etc
rvar_mean(x)
rvar_median(x)
rvar_sum(x)
rvar_prod(x)
rvar_range(x)
rvar_quantile(x, probs = c(0.25, 0.5, 0.75), names = TRUE)
Run the code above in your browser using DataLab