add_group_sub | R Documentation |
Add sub index within group
add_group_sub(df, group, sep = "_", tmp_col = "tmp_col")
df |
A dataframe. |
group |
A string or string vector. When vector, the first string will be used for adding sub index. |
sep |
A string for separator. |
tmp_col |
A string of colnames for temporary use. |
A dataframe.
library(dplyr)
add_group_sub(mtcars, c("am", "gear"))
add_group_sub(mtcars, c("cyl", "am"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.