This is a wrapper for unlist() that defaults to
recursive = FALSE.
Usage
flatten(.x, .recursive = FALSE, .unname = FALSE)
Arguments
.x
A list of flatten
.recursive
Recursively flatten list components?
.unname
Remove names before flattening?
Details
When .unname is TRUE and .recursive is
FALSE, only the names of .x are removed, leaving the
inner lists intact. But if .recursive is TRUE, the
names of all inner lists are also removed.
x <- rerun(10, sample(5))
x %>% flatten(x)
# You can use flatten in conjunction with mapx %>% map(~ .x[1]) %>% flatten()
# But it's better to use map_int etc.x %>% map_int(~ .x[1])