Learn R Programming

secr (version 4.6.10)

trim: Drop Unwanted List Components

Description

Drop unwanted components from a list object, usually to save space.

Usage

# S3 method for default
trim(object, drop, keep)
# S3 method for secr
trim(object, drop = c("call", "mask", "designD", "designNE", 
    "design", "design0"), keep = NULL)
# S3 method for secrlist
trim(object, drop = c("call", "mask", "designD", "designNE", 
    "design", "design0"), keep = NULL)

Value

a list retaining selected components.

Arguments

object

a list object

drop

vector identifying components to be dropped

keep

vector identifying components to be kept

Details

drop may be a character vector of names or a numeric vector of indices. If both drop and keep are given then the action is conservative, dropping only components in drop and not in keep.

Be warned that some further operations on fitted secr objects become impossible once you have discarded the default components.

Examples

Run this code

names(secrdemo.0)
names(trim(secrdemo.0))

object.size(secrdemo.0)
object.size(trim(secrdemo.0))

object.size(trim(secrlist(secrdemo.0, secrdemo.b)))

Run the code above in your browser using DataLab