Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

assignList

Assign Values In a List to Names


Description

Assigns the values in a list to variables in an environment. The variable names are taken from the names of the list, so all of the elements of the list must have non-blank names.

Usage

assignList(aList, pos = -1, envir = as.environment(pos), inherits = FALSE)

Arguments

aList

a list of values to be assigned to variables with names given by names(aList).

pos

where to do the assignment. By default, assigns into the current environment.

envir

the environment to use.

inherits

should the enclosing frames of the environment be inspected?

Details

See assign for details on how R assignment works. This function simply uses the elements of names(aList) and aList itself to call the .Internal function used by assign once for each element of aList.

Value

This function is invoked for its side effect, which assigns values to the variables with names given by names(aList).

See Also

Examples

myList <- list(a = 1, b = 2, c = 3)
assignList(myList) ## equivalent to a <- 1; b <- 2; c <- 3

tis

Time Indexes and Time Indexed Series

v1.38
Unlimited
Authors
Jeff Hallman <jeffhallman@gmail.com>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.