Learn R Programming

RMark (version 3.0.0)

collect.models: Collect MARK models into a list and optionally construct a table of model results

Description

Collects mark models contained in lx of specified type (if any) and returns models in a list with a table of model results if table=TRUE.

Usage

collect.models(
  lx = NULL,
  type = NULL,
  table = TRUE,
  adjust = TRUE,
  external = FALSE
)

Value

model.list: a list of mark models and optionally a table of model results.

Arguments

lx

if NULL, constructs vector of object names (ls()) from frame of calling function otherwise it uses specifed names in lx

type

either NULL (for all types) or a character vector model type (e.g. type="CJS")

table

if TRUE, a table of model results is also included in the returned list

adjust

if TRUE, adjusts number of parameters (npar) to number of columns in design matrix which modifies AIC

external

if TRUE the mark objects are saved externally rather than in the resulting marklist; the filename for each object is kept in its place

Author

Jeff Laake

Details

If lx is NULL a vector of object names in the parent frame is constructed for lx. Within lx all mark model objects (i.e., class(x)[1]=="mark") are returned if type is NULL. If type is specified and is valid, then the names of all mark model objects of the specified type (i.e., class(x) = c("mark",type)) in lx are returned. If table=TRUE a table of model selection results is also included in the returned list.

This function was written to be able to easily collect a series of mark models in a list without specifying the names of each model object. This is useful in constructing a return value of a function that runs a series of models for a particular analysis. For an example see dipper.

See Also

merge.mark,remove.mark, collect.model.names,run.models,model.table,dipper

Examples

Run this code

# see examples in dipper, edwards.eberhardt and example.data

Run the code above in your browser using DataLab