Description Usage Arguments Details Examples
Add one or more stages to an experiment
1 | add_stage(experiment, ..., times, each, after)
|
experiment |
an Experiment object |
... |
one or more Stage objects, or functions |
times |
how many times to repeat the sequence of stages in |
each |
how many times to repeat each individual stage |
after |
Add stages after how many stages (default: at the end) |
If functions are passed in to add_stage
, Stage objects will
automatically be created from them.
Stage objects are reference classes. However,
when added to the experiment, they are copied. So, changing the
Stage after adding it to the experiment will not work.
1 2 3 4 5 6 7 8 | expt <- experiment(N=1, autostart=TRUE)
s1 <- stage(function(id, period, params) return("Got to s1!"))
# Or just define the function directly:
s2 <- function(id, period, params) return("Got to s2!")
add_stage(expt, s1, s2, times=2) # s1 s2 s1 s2
add_stage(expt, s1, s2, times=1:2) # s1 s2 s2
add_stage(expt, s1, s2, each=2) # s1 s1 s2 s2
info(expt)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.