dice_plot | 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 z
and allows customization of various plot aesthetics.
dice_plot(
data,
x = NULL,
y = NULL,
z = NULL,
group = NULL,
group_alpha = 0.5,
title = NULL,
z_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_x = 0.5,
base_height_per_y = 0.3,
reverse_ordering = FALSE,
cluster_by_row = TRUE,
cluster_by_column = TRUE,
show_legend = TRUE,
cat_a = NULL,
cat_b = NULL,
cat_c = NULL,
cat_c_colors = NULL,
cat_b_order = NULL,
base_width_per_cat_a = NULL,
base_height_per_cat_b = NULL
)
data |
A data frame containing the categorical and group variables for plotting. |
x |
A string representing the column name in |
y |
A string representing the column name in |
z |
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 |
z_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_x |
Used for dynamically scaling the width. Default is 0.5. |
base_height_per_y |
Used for dynamically scaling the height. Default is 0.3. |
reverse_ordering |
Should the cluster ordering be reversed?. Default is FALSE. |
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 |
cat_a |
Deprecated. Use |
cat_b |
Deprecated. Use |
cat_c |
Deprecated. Use |
cat_c_colors |
Deprecated. Use |
cat_b_order |
Deprecated. Use |
base_width_per_cat_a |
Deprecated. Use |
base_height_per_cat_b |
Deprecated. Use |
A ggplot object representing the dice plot.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.