Produces an experiment object from the replication of an experiment object.

repl(exp, times = NULL)

# S3 method for default
repl(exp, times = NULL)

# S3 method for experiment
repl(exp, times = NULL)

Arguments

exp

An object of class experiment.

times

Number of replicates or a named vector of rows to propagate in exp.

Value

An object of class experiment that is the replication of the inputed x argument.

Details

Parameters times and exp are exclusive. If both specified, times will be taken.

Examples

exp <- load_experiment("sir", system.file("models", "sir.gaml", package = "gamar"))
#> Loading experiment "sir" from file "sir.gaml"...
#>
#> Periods of observation ("obsrates") are converted into integers.
#>
#> Final time step ("tmax") is converted into integer.
#>
#> Seed is converted into numeric.
#>
#> Parameters' types are cast according to model definition
#>
exp1 <- repl(exp, times = 4) exp1$seed <- c(1:4) repl(exp1, times = c("1" = 3, "4" = 5))
#> Experiment with 12 simulations of 5 parameters and 3 observed variables #> experiment name: sir #> input gaml file: /Users/mac/Desktop/gamar/inst/models/sir.gaml #> model parameters: p_S0, p_I0, p_R0, p_beta, p_gamma #> observed variables: r_S, r_I, r_R #> Experiment overview: #> p_S0 p_I0 p_R0 p_beta p_gamma r_S r_I r_R tmax seed output #> 1 999 1 0 1.5 0.15 1 1 1 1000 1 NA #> 2 999 1 0 1.5 0.15 1 1 1 1000 2 NA #> 3 999 1 0 1.5 0.15 1 1 1 1000 3 NA #> 4 999 1 0 1.5 0.15 1 1 1 1000 4 NA #> 5 999 1 0 1.5 0.15 1 1 1 1000 1 NA #> 6 999 1 0 1.5 0.15 1 1 1 1000 1 NA #> 7 999 1 0 1.5 0.15 1 1 1 1000 1 NA #> 8 999 1 0 1.5 0.15 1 1 1 1000 4 NA #> 9 999 1 0 1.5 0.15 1 1 1 1000 4 NA #> 10 999 1 0 1.5 0.15 1 1 1 1000 4 NA #> 11 999 1 0 1.5 0.15 1 1 1 1000 4 NA #> 12 999 1 0 1.5 0.15 1 1 1 1000 4 NA