PBSmodelling (version 2.68.8)

packList: Pack a List with Objects

Description

Pack a list with existing objects using names only.

Usage

packList(stuff, target="PBSlist", value, penv=NULL, tenv=.PBSmodEnv)

Value

No value is returned

Arguments

stuff

character -- vector of object names

target

character -- name of target list object

value

numeric|character -- an optional explicit value to assign to stuff

penv

environment -- source environment (default=parent) or user-specified environment where stuff resides

tenv

environment -- target environment where target list exists or will be located

Author

Rowan Haigh, Program Head -- Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Institute of Ocean Sciences (IOS), Sidney BC
Last modified Rd: 2019-03-12

Details

A list object called target will be located in the tenv environment. The objects named in stuff and located in the penv environment will appear as named components within the list object target.

If an explicit value is specified, the function uses this value instead of looking for local objects. Essentially, stuff = value which is then packed into target.

See Also

In package PBSmodelling:
unpackList, readList, writeList
Accessor functions:
tget, tcall, tprint, and tput

Examples

Run this code
local(envir=.PBSmodEnv,expr={
  fn = function() {
    alpha=rnorm(10)
    beta=letters
    gamma=mean
    delta=longley
    packList(c("alpha","beta","gamma","delta")) }
  fn(); tprint(PBSlist)
})

Run the code above in your browser using DataCamp Workspace