View source: R/color_functions.R
hcl_rainbow | R Documentation |
Convenience function to change the color scheme to the rainbow_hcl scheme provided by the colorspace package. The function will detect how many strata are available and will pick that many colors from rainbow_hcl.
hcl_rainbow(g, reverse = FALSE, c = 50, l = 70, start = 0, end = 360 * (n - 1)/n)
g |
ggplot object containing a Kaplan-Meier plot |
reverse |
should the order of the colors be reversed? |
c |
chroma |
l |
luminance |
start |
the hue at which the rainbow begins |
end |
the hue at which the rainbow ends |
Returns a ggplot object
Daniel Lindholm
library(survival) library(dplyr) veteran %>% survfit(Surv(time, status) ~ celltype, data = .) %>% plot_survfit(cuminc = FALSE) %>% hcl_rainbow()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.