Learn R Programming

textshape (version 1.7.3)

flatten: Flatten a Nested List of Vectors Into a Single Tier List of Vectors

Description

Flatten a named, nested list of atomic vectors to a single level using the concatenated list/atomic vector names as the names of the single tiered list.

Usage

flatten(x, sep = "_", ...)

Value

Returns a flattened list.

Arguments

x

A nested, named list of vectors.

sep

A separator to use for the concatenation of the names from the nested list.

...

ignored.

Author

StackOverflow user @Michael and Paul Foster and Tyler Rinker <tyler.rinker@gmail.com>.

References

https://stackoverflow.com/a/41882883/1000343
https://stackoverflow.com/a/48357114/1000343