View source: R/add_quantiles.R
add_quantiles | R Documentation |
Method to add quantile lines to a plot.
add_quantiles(gg, ...)
## S3 method for class 'ggsurvfit'
add_quantiles(
gg,
quantiles = 0.5,
linetype = "dashed",
linecolour = "grey50",
alpha = 1,
...
)
gg |
A ggplot created with visR |
... |
other arguments passed on to the method to modify |
quantiles |
vector of quantiles to be displayed on the probability scale, default: 0.5 |
linetype |
string indicating the linetype as described in the aesthetics of ggplot2 |
linecolour |
string indicating the linetype as described in the aesthetics of ggplot2 |
alpha |
numeric value between 0 and 1 as described in the aesthetics of ggplot2 |
Lines indicating the quantiles overlayed on a visR ggplot
library(visR)
adtte %>%
estimate_KM("SEX") %>%
visr() %>%
add_quantiles()
adtte %>%
estimate_KM("SEX") %>%
visr() %>%
add_quantiles(quantiles = c(0.25, 0.50))
adtte %>%
estimate_KM("SEX") %>%
visr() %>%
add_quantiles(
quantiles = c(0.25, 0.50),
linetype = "solid",
linecolour = "grey"
)
adtte %>%
estimate_KM("SEX") %>%
visr() %>%
add_quantiles(
quantiles = c(0.25, 0.50),
linetype = "mixed",
linecolour = "strata"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.