Learn R Programming

secr (version 4.6.9)

list.secr.fit: Fit Multiple SECR Models

Description

This function is a wrapper for secr.fit that allows multiple models to be fitted.

Usage

list.secr.fit (..., constant = list(), prefix = "fit", names = NULL)

Value

An secrlist of model fits (see secr.fit).

Arguments

...

varying arguments of secr.fit

constant

list of named arguments held constant

prefix

character prefix for automatic names

names

character names of output

Details

The ... argument may be one or several vectors of the same length that refers to a different named argument of secr.fit. secr.fit is called with the constant arguments plus the first value in each vector, then the second value, etc. The logic follows mapply.

Each of the ... arguments may also be a named argument with a single value, although the compound values should be wrapped in list(), passed by name (in quotes), or placed in the 'constant' list to avoid misinterpretation. For example, the capthist argument of secr.fit should be be wrapped in list() or " " if it is placed outside 'constant'.

'prefix' is used only if 'names' is not supplied.

See Also

secr.fit, AIC.secr, predict.secr

Examples

Run this code

if (FALSE) {

# fit two detection models
fits <- list.secr.fit (model = c(g0~1, g0~b), constant = list(captdata, trace = FALSE))
AIC(fits)

# alternatively,
fits <- list.secr.fit ('captdata', model = c(g0~1, g0~b), trace = FALSE)
AIC(fits)

# replacing par.derived and par.region.N:

lapply(fits, derived)
lapply(fits, region.N)

}

Run the code above in your browser using DataLab