View source: R/h_survival_duration_subgroups.R
h_split_by_subgroups | R Documentation |
Split a data frame into a non-nested list of subsets.
h_split_by_subgroups(data, subgroups, groups_lists = list())
data |
( |
subgroups |
( |
groups_lists |
(named |
Main functionality is to prepare data for use in forest plot layouts.
A list with subset data (df
) and metadata about the subset (df_labels
).
df <- data.frame(
x = c(1:5),
y = factor(c("A", "B", "A", "B", "A"), levels = c("A", "B", "C")),
z = factor(c("C", "C", "D", "D", "D"), levels = c("D", "C"))
)
formatters::var_labels(df) <- paste("label for", names(df))
h_split_by_subgroups(
data = df,
subgroups = c("y", "z")
)
h_split_by_subgroups(
data = df,
subgroups = c("y", "z"),
groups_lists = list(
y = list("AB" = c("A", "B"), "C" = "C")
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.