Automatically detects placebo and treatment groups from treatment variable and assigns appropriate colors following clinical conventions.
Details
This function uses pattern matching to identify placebo groups and assigns neutral grey color, while active treatments get distinct colors.
Placebo detection patterns include: "placebo", "control", "sham", case-insensitive matching.
Examples
treatments <- c("Placebo", "Drug A 10mg", "Drug A 20mg")
colors <- assign_treatment_colors(treatments)
