collect: Collect elements from a list of lists

View source: R/util.R

collectR Documentation

Collect elements from a list of lists

Description

This function 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)

Arguments

xx

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

Value

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

Examples

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

FastRet documentation built on June 25, 2024, 5:07 p.m.