df_to_ldf | R Documentation |
Splits a data.frame by a variable and returns a named list.
df_to_ldf(data, by, remove_by = T)
data |
(data.frame) The data.frame. |
by |
(character scalar or vector) The values to split by. If input is a character scalar, will use that variable from the data.frame. If it is a longer vector, will use that to split with. |
remove_by |
(logical scalar) Whether to remove the vector used to split with from the data.frame. Only relevant when using a character scalar as input to by. |
df_to_ldf(iris[c(1:5, 51:55, 101:105), ], "Species") #split iris by Species.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.