set_levels | R Documentation |
Set one or more simulation levels, which are things that vary between simulation replicates.
set_levels(sim, ..., .keep = NA)
sim |
A simulation object of class |
... |
One or more key-value pairs representing simulation levels. Each value can either be a vector (for simple levels) or a list of lists (for more complex levels). See examples. |
.keep |
An integer vector of level_id values specifying which level combinations to keep; see the Advanced Functionality documentation. |
The original simulation object with the old set of levels replaced with the new set
# Basic simulation levels are numeric or character vectors
sim <- new_sim()
sim %<>% set_levels(
n = c(10, 100, 1000),
est = c("M", "V")
)
# Complex simulation levels can be set using named lists of lists
sim <- new_sim()
sim %<>% set_levels(
n = c(10, 100, 1000),
distribution = list(
"Beta 1" = list(type="Beta", params=c(0.3, 0.7)),
"Beta 2" = list(type="Beta", params=c(1.5, 0.4)),
"Normal" = list(type="Normal", params=c(3.0, 0.2))
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.