cat4: Convenience function for four-category color scheme

View source: R/color_functions.R

cat4R Documentation

Convenience function for four-category color scheme

Description

Convenience function to change the color scheme to four colors: Green, blue, red, and yellow; i.e. like the ski slopes but with yellow instead of black.

Usage

cat4(g, reverse = FALSE)

Arguments

g

ggplot object containing a Kaplan-Meier plot

reverse

should the order of the colors be reversed?

Value

Returns a ggplot object

Author(s)

Daniel Lindholm

Examples

library(survival)
library(dplyr)
veteran %>%
    survfit(Surv(time, status) ~ celltype, data = .) %>%
   plot_survfit(cuminc = FALSE) %>%
   cat4(reverse = TRUE)

dlindholm/survsup documentation built on Jan. 12, 2023, 2:34 p.m.