Learn R Programming

FastRet (version 1.3.0)

collect: Collect elements from a list of lists

Description

Takes a list of lists where each inner list has the same names. It returns a list where each element corresponds to a name of the inner list that is extracted from each inner list. Especially useful for collecting results from lapply.

Usage

collect(xx)

Value

A list where each element corresponds to a name of the inner list that is extracted from each inner list.

Arguments

xx

A list of lists where each inner list has the same names.

Examples

Run this code
xx <- lapply(1:3, function(i) list(a = i, b = i^2, c = i^3))
ret <- collect(xx)

Run the code above in your browser using DataLab