Learn R Programming

secrdesign (version 2.9.2)

expand.arg: Expand Argument List

Description

Generate a list of lists from vectors of argument values.

Usage

expand.arg(..., sublist = list())

Value

A list of lists. A flat dataframe of combinations is returned as the attribute 'comb'.

Arguments

...

named vectors of argument values

sublist

named list of character vectors

Details

The full 'pop.args', 'det.args' and 'fit.args' arguments of run.scenarios are lists of lists corresponding to the popindex, detindex and fitindex columns in scenarios.

expand.arg constructs such lists from all possible combinations of specified arguments, with invariant arguments appended.

sublist may be specified to shift one or more named subsets of ... arguments to a sub-list such as 'detectpar' (see Examples).

See Also

run.scenarios

Examples

Run this code

## generate some arguments for sim.capthist
## noccasions is constant

expand.arg(detectfn = c('HN','EX'), noccasions = 5)

## detectpar sub-list

expand.arg(lambda0 = c(0.1, 0.2), sigma = 20, detectfn = c('HHN','HEX'),
    sublist = list(detectpar = c('lambda0','sigma')))

Run the code above in your browser using DataLab