View source: R/add_highlight.R
add_highlight | R Documentation |
S3 method for highlighting a specific strata by lowering the opacity of all other strata.
add_highlight(gg, ...)
## S3 method for class 'ggsurvfit'
add_highlight(gg = NULL, strata = NULL, bg_alpha = 0.2, ...)
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 |
The input ggsurvfit
object with adjusted alpha
values
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.