R/flatten_list_of_lists.R
flatten_list_of_lists.Rd
This function takes a hierarchical structure of lists and extracts all atomic vectors, returning one flat list of all those vectors.
flatten_list_of_lists(x)
x | The list of lists. |
---|
A list of atomic vectors.
### First create a list of lists listOfLists <- list(list(list(1:3, 8:5), 7:7), list(1:4, 8:2)); yum::flatten_list_of_lists(listOfLists);#> [[1]] #> [1] 1 2 3 #> #> [[2]] #> [1] 8 7 6 5 #> #> [[3]] #> [1] 7 #> #> [[4]] #> [1] 1 2 3 4 #> #> [[5]] #> [1] 8 7 6 5 4 3 2 #>