View source: R/superseded-flatten.R
flatten | R Documentation |
These functions were superseded in purrr 1.0.0 because their behaviour was inconsistent. Superseded functions will not go away, but will only receive critical bug fixes.
flatten()
has been superseded by list_flatten()
.
flatten_lgl()
, flatten_int()
, flatten_dbl()
, and flatten_chr()
have been superseded by list_c()
.
flatten_dfr()
and flatten_dfc()
have been superseded by list_rbind()
and list_cbind()
respectively.
flatten(.x)
flatten_lgl(.x)
flatten_int(.x)
flatten_dbl(.x)
flatten_chr(.x)
flatten_dfr(.x, .id = NULL)
flatten_dfc(.x)
.x |
A list to flatten. The contents of the list can be anything for
|
flatten()
returns a list, flatten_lgl()
a logical
vector, flatten_int()
an integer vector, flatten_dbl()
a
double vector, and flatten_chr()
a character vector.
flatten_dfr()
and flatten_dfc()
return data frames created by
row-binding and column-binding respectively. They require dplyr to
be installed.
x <- map(1:3, \(i) sample(4))
x
# was
x |> flatten_int() |> str()
# now
x |> list_c() |> str()
x <- list(list(1, 2), list(3, 4))
# was
x |> flatten() |> str()
# now
x |> list_flatten() |> str()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.