compare_pairs | R Documentation |
Compare pairs of categorical variables
compare_pairs(data, levels, values, f = `-`)
data |
a dataframe |
levels |
a column with a categorical variable. All pairs of values in
|
values |
a column with values to compare. |
f |
comparison function to apply to values in each pair. Defaults to |
a dataframe with pairwise comparisons
to_compare <- nlme::Machines %>% dplyr::group_by(Worker) %>% dplyr::summarise(avg_score = mean(score)) %>% print() to_compare %>% compare_pairs(Worker, avg_score) %>% dplyr::rename(difference = value) %>% dplyr::mutate_if(is.numeric, round, 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.