unlistRecursive: For any object in a list that is also a list, unlist it

View source: R/unlistRecursive.r

unlistRecursiveR Documentation

For any object in a list that is also a list, unlist it

Description

This function takes as an argument a list. If any of its elements are also lists, it unlists them. The output is the same as the input, except that there will be one new element per element in each sublist, and the sublists will be removed.

Usage

unlistRecursive(x)

Arguments

x

A list.

Value

A list.

See Also

unlist

Examples


x <- list(
   a = 1:3,
   b = list(
      b1 = c("The", "quick", "brown", "function"),
	     b2 = 4:1,
      b3 = list(
         b3_1 = 5:7
      )
   ),
   c = "end"
)

unlistRecursive(x)


adamlilith/omnibus documentation built on April 12, 2024, 8:46 p.m.