View source: R/wrangling-fcns.R
| split_and_key | R Documentation |
Like group_split but uses grouping cols to form identifiers and uses these as names for elements of split df. A broader purpose fcn that I may move elsewhere at some point. Some surprise/discussion that this functionality isn't already built into dplyr: https://stackoverflow.com/questions/57107721/how-to-name-the-list-of-the-group-split-output-in-dplyr
split_and_key(x, .cols)
x |
object that inherits |
cols |
a character vector of columns to split/groupby. Concatenation of these column names, separated by "-" will form the name for each resulting df after split. |
Reminder that a nest/unnest workflow is often better in most cases, rather than splitting
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.