Creates advanced raincloud plots with longitudinal connections using ggrain package. This module complements the existing Raincloud Plot module by providing advanced features including longitudinal data connections, Likert scale support, and flexible raincloud positioning. Perfect for repeated measures data, survey analysis, and complex distribution visualization in clinical research. Uses the ggrain package for enhanced customization and connectivity features.
Usage
advancedraincloud(
data,
y_var,
x_var,
fill_var = NULL,
id_var = NULL,
cov_var = NULL,
rain_side = "l",
likert_mode = FALSE,
show_longitudinal = FALSE,
point_size = 1.5,
point_alpha = 0.7,
violin_alpha = 0.7,
boxplot_width = 0.1,
color_palette = "clinical",
plot_title = "Advanced Raincloud Plot",
x_label = "",
y_label = "",
show_statistics = TRUE,
show_comparisons = FALSE,
show_interpretation = TRUE
)
Arguments
- data
The data as a data frame.
- y_var
Continuous variable for distribution visualization on Y-axis.
- x_var
Grouping variable for X-axis categories.
- fill_var
Optional variable for color filling different groups.
- id_var
Optional ID variable for connecting longitudinal observations across groups.
- cov_var
Optional variable for remapping point colors based on covariate values.
- rain_side
Position of the raincloud relative to the data points.
- likert_mode
If TRUE, adds Y-axis jittering for Likert scale or ordinal data.
- show_longitudinal
If TRUE, connects repeated observations using the ID variable.
- point_size
Size of individual data points.
- point_alpha
Transparency level for data points.
- violin_alpha
Transparency level for violin plots.
- boxplot_width
Width of the boxplot component.
- color_palette
Color palette for different groups.
- plot_title
Title for the raincloud plot.
- x_label
Custom label for X-axis. If empty, uses variable name.
- y_label
Custom label for Y-axis. If empty, uses variable name.
- show_statistics
If TRUE, displays summary statistics table.
- show_comparisons
If TRUE, performs statistical tests between groups.
- show_interpretation
If TRUE, displays interpretation and feature guide.