Description Usage Arguments Value Author(s) Examples
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.
1 2 | 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
1 2 3 4 5 6 | 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.