View source: R/compare_by_group.R
| compare_by_group | R Documentation |
Compares two datasets within subgroups defined by grouping variables. Performs separate comparisons for each group and returns results organized by group.
compare_by_group(df1, df2, group_vars)
df1 |
A data frame representing the first dataset. |
df2 |
A data frame representing the second dataset. |
group_vars |
A character vector of column names to group by. |
A list of comparison results for each group.
df1 <- data.frame(region = c("A", "A", "B"), value = c(10, 20, 30),
stringsAsFactors = FALSE)
df2 <- data.frame(region = c("A", "A", "B"), value = c(10, 25, 30),
stringsAsFactors = FALSE)
compare_by_group(df1, df2, group_vars = "region")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.