hcl_rainbow: Convenience function for the rainbow_hcl color scheme

Description Usage Arguments Value Author(s) Examples

Description

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.

Usage

1
2
hcl_rainbow(g, reverse = FALSE, c = 50, l = 70, start = 0,
  end = 360 * (n - 1)/n)

Arguments

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

Value

Returns a ggplot object

Author(s)

Daniel Lindholm

Examples

1
2
3
4
5
6
library(survival)
library(dplyr)
veteran %>%
    survfit(Surv(time, status) ~ celltype, data = .) %>%
   plot_survfit(cuminc = FALSE) %>%
   hcl_rainbow()

survsup documentation built on May 7, 2019, 9:02 a.m.