# For a total of 40, `n` is 20:
disperse(n = 20)
disperse(n = 20, dispersion = c(3, 6, 10))
# For an odd total, `disperse2()` takes two group sizes:
disperse2(n = c(25, 26))
# `disperse_total()` takes the total itself:
disperse_total(n = 40)
disperse_total(n = 51)
# Values that repeat alongside the pairs:
disperse_total(37, constant = c("5.24", "3.80"))
df_constant <- tibble::tibble(
name = c("Paul", "Mathilda"), age = 27:28,
registered = c(TRUE, FALSE)
)
disperse_total(37, constant = df_constant)
Run the code above in your browser using DataLab