Replicate rep uses set ceiling(rep / repsPerSet) (paramSetIndex() cycles through the sets), and is replicate ((rep - 1) %% repsPerSet) + 1 within it. The set keeps the columns of the simulated ELF's ledger row (sa$params), and the random-effect sds it has.

paramSetsForRep(sim, sa, rep)

Arguments

sim

A simList; parameters paramSets, repsPerSet.

sa

sim$studyAreaWithSpreadParams, one row per ELF.

rep

integer; the replicate (.rep, or replicateOf()).

Value

A list: own (the simulated ELF's row of sa), set (its index in the file), k (the replicate within the set) and params (the one-row data.frame).