add_highlight {visR} | R Documentation |
Highlight a specific strata
Description
S3 method for highlighting a specific strata by lowering the opacity of all other strata.
Usage
add_highlight(gg, ...)
## S3 method for class 'ggsurvfit'
add_highlight(gg = NULL, strata = NULL, bg_alpha = 0.2, ...)
Arguments
gg |
A ggplot created with visR |
... |
other arguments passed on to the method |
strata |
String representing the name and value of the strata to be highlighted as shown in the legend. |
bg_alpha |
A numerical value between 0 and 1 that is used to decrease the opacity off all strata not chosen to be highlighted in |
Value
The input ggsurvfit
object with adjusted alpha
values
Examples
adtte %>%
visR::estimate_KM(strata = "SEX") %>%
visR::visr() %>%
visR::add_CI(alpha = 0.4) %>%
visR::add_highlight(strata = "M", bg_alpha = 0.2)
strata <- c("Placebo", "Xanomeline Low Dose")
adtte %>%
visR::estimate_KM(strata = "TRTP") %>%
visR::visr() %>%
visR::add_CI(alpha = 0.4) %>%
visR::add_highlight(strata = strata, bg_alpha = 0.2)
[Package visR version 0.4.1 Index]