from_named_list {lazy.tools}R Documentation

Retrieve Objects from a Named List

Description

Retrieve Objects from a Named List

Usage

from_named_list(nl)

Arguments

nl

A named list

Details

This function defines or replaces the objects in the parent frame.

mapply( assign, names(nl), nl, MoreArgs=list(envir=parent.frame()) )

Examples


# in global env.:
a=1; a1=2; b=1:2
nl=named_list( a, a1=a+3, b, 3:4, d=5:6, "E" )
rmv(a,b,temp_var4,d,E)
from_named_list( nl )
Print(a,a1,b,temp_var4,d,E)

# in a function:
f <- function(){
 nl=list(a=1,b=2)
 from_named_list( nl )
 Print("in function f:",a,b)
}
f()


[Package lazy.tools version 0.1.4 ]