Description Usage Arguments Details Examples
View source: R/map_experiment.R
Maps the data of a data frame on the structure on an object of class
experiment
.
1 |
df |
A data frame containing variables and parameters values for a
number of simulations we wish to use for the experiment |
exp |
An object of class |
The names of the columns of the data frame should correspond to the names of the variables and parameters of the experiment. This can work only if one of the following conditions is met:
the sets of names of the data frame and experiment are identical;
the names of the data frame are included in the names of the experiment AND the numbers of rows of the data frame and the experiment are identical.
1 2 3 4 5 6 7 8 9 10 11 12 | # First situation: the sets of names of the data frame and the experiment
# are exactly the same:
if (exists("sir1", inherits = FALSE)) rm(sir1)
exp <- sir1
df <- as.data.frame(repl(sir1, 3))
map_experiment(df, exp)
# Second situation: the names of the data frame are included in the names of
# the experiment AND the numbers of rows of the data frame and the experiment
# are equal:
exp <- repl(sir1, 3)
df <- as.data.frame(exp)[, c(1, 3, 6)]
map_experiment(df, exp)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.