Custom wrapper for geom_density
geom_density_RR.Rd
Custom wrapper for geom_density
Arguments
- ...
Other arguments passed on to
layer()
. These are often aesthetics, used to set an aesthetic to a fixed value, likecolour = "red"
orsize = 3
. They may also be parameters to the paired geom/stat.- alpha
Degree of transparency in the density plots.
Examples
library(ggplot2)
# Generate example data
set.seed(123)
data <- data.frame(
Group = rep(c("Group1", "Group2"), each = 200),
Value = c(rnorm(200, mean = 0, sd = 1), rnorm(200, mean = 2, sd = 1)))
# Create density plot
data |>
ggplot(aes(x = Value, fill = Group)) +
theme_RR() +
geom_density_RR(alpha = 0.5) +
labs(x = "Value", y = "Density",
fill = "Group") +
scale_fill_RR()