packList | R Documentation |
Pack a list with existing objects using names only.
packList(stuff, target="PBSlist", value, penv=NULL, tenv=.PBSmodEnv)
stuff |
|
target |
|
value |
|
penv |
|
tenv |
|
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
.
No value is returned
The function determines the parent environment from within.
This environment contains the objects from which the function copies to the target environment.
Alternatively, the user can specify the environment where stuff
resides.
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
In package PBSmodelling:
unpackList
,
readList
,
writeList
Accessor functions:
tget
,
tcall
,
tprint
, and
tput
local(envir=.PBSmodEnv,expr={
fn = function() {
alpha=rnorm(10)
beta=letters
gamma=mean
delta=longley
packList(c("alpha","beta","gamma","delta")) }
fn(); tprint(PBSlist)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.