| unnest | R Documentation |
unnest() is the inverse of nest(). Each element of a list-column is
expanded into rows, and the other columns are repeated to match. Elements
may be data frames (their columns are added) or atomic vectors (the values
are stored under the list-column's own name). Rows whose element is empty
are dropped.
unnest(data, cols)
data |
A data frame with one or more list-columns. |
cols |
Character vector of list-columns to expand. When several are given, their elements must have matching lengths within each row. |
A basetable with one row per element.
nest()
nested <- nest(data.frame(g = c("a", "a", "b"), x = 1:3), by = "g")
unnest(nested, "data")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.