collect.model.names: Collect names of MARK model objects from list of R objects...

View source: R/collect.model.names.R

collect.model.namesR Documentation

Collect names of MARK model objects from list of R objects (internal function)

Description

Either names of all mark model objects (type=NULL) or names of mark model objects of a specific type (type) are extracted from a vector of R objects (lx) that was collected from the parent environment (frame) of the function that calls collect.model.names. Thus, it is two frames back (parent.frame(2)).

Usage

collect.model.names(lx, type = NULL, warning = TRUE)

Arguments

lx

vector of R object names from parent.frame(2)

type

either NULL (for all types) or a character model type (eg "CJS")

warning

if TRUE warning given when models of different types are collected

Details

If type=NULL then the names of all objects of class(x)[1]="mark" in lx are returned. If type is specified, then the names of all objects of class(x)=c("mark",type) in lx are returned.

This function was written with the intention that it would be called from other functions ( e.g., collect.models, run.models) but it will work if called directly (e.g., collect.model.names( lx=ls())). While this function returns a vector of model names, collect.models returns a list of model objects. The latter can be used to easily create a list of models created in a function to be used as a return value without listing all the names of the functions. It uses collect.model.names to perform that function.

Value

model.list: a vector of mark model names

Author(s)

Jeff Laake

See Also

collect.models, run.models, model.table


RMark documentation built on Aug. 14, 2022, 1:05 a.m.