dice_plot {diceplot} | R Documentation |
This function generates a custom plot based on three categorical variables and a group variable. It adapts to the number of unique categories in cat_c
and allows customization of various plot aesthetics.
dice_plot(
data,
cat_a,
cat_b,
cat_c,
group = NULL,
group_alpha = 0.5,
title = NULL,
cat_c_colors = NULL,
group_colors = NULL,
custom_theme = theme_minimal(),
max_dot_size = 5,
min_dot_size = 2,
legend_width = 0.25,
legend_height = 0.5,
base_width_per_cat_a = 0.5,
base_height_per_cat_b = 0.3,
reverse_ordering = FALSE,
cat_b_order = NULL,
cluster_by_row = TRUE,
cluster_by_column = TRUE,
show_legend = TRUE
)
data |
A data frame containing the categorical and group variables for plotting. |
cat_a |
A string representing the column name in |
cat_b |
A string representing the column name in |
cat_c |
A string representing the column name in |
group |
A string representing the column name in |
group_alpha |
A numeric value for the transparency level of the group rectangles. Default is |
title |
An optional string for the plot title. Defaults to |
cat_c_colors |
A named vector of colors for |
group_colors |
A named vector of colors for the group variableor a string to chose a colorbrewer palette. Defaults to |
custom_theme |
A ggplot2 theme for customizing the plot's appearance. Defaults to |
max_dot_size |
Maximal dot size for the plot to scale the dot sizes. |
min_dot_size |
Minimal dot size for the plot to scale the dot sizes. |
legend_width |
Relative width of your legend. Default is 0.25. |
legend_height |
Relative width of your legend. Default is 0.5. |
base_width_per_cat_a |
Used for dynamically scaling the width. Default is 0.5. |
base_height_per_cat_b |
Used for dynamically scaling the height. Default is 0.3. |
reverse_ordering |
Should the cluster ordering be reversed?. Default is FALSE. |
cat_b_order |
Do you want to pass an explicit order?. Default is NULL. |
cluster_by_row |
Cluster rows, defaults to TRUE |
cluster_by_column |
Cluster columns, defaults to TRUE |
show_legend |
Do you want to show the legend? Default is TRUE |
A ggplot object representing the dice plot.