Description Usage Arguments Value Author(s) See Also Examples
View source: R/add_annotation.R
This function accepts a string, dataframe, data.table, tibble or customized objects of class gtable
and
places them on the specified location on the ggplot
. The layout is fixed: bold columnheaders and plain body. Only the
font size and type can be chosen.
1 2 3 4 5 6 7 8 9 10 |
gg |
Object of class |
lbl |
|
base_family |
|
base_size |
|
xmin, |
xmax x coordinates giving horizontal location of raster in which to fit annotation. |
ymin, |
ymax y coordinates giving vertical location of raster in which to fit annotation. |
Object of class ggplot
with added annotation with an object of class gtable
.
Steven Haesendonckx
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | library(survival)
library(dplyr)
library(tidyr)
library(ggplot2)
## Estimate survival
surv_object <- vr_KM_est(data = adtte, strata = "TRTP")
## p value for "Equality across strata"
lbl <- get_pvalue(survfit_object, statlist = c("test", "p"), type = "All")
## add results to survival plot
vr_plot(survfit_object) %>%
add_annotation(lbl = lbl, base_family = "sans", base_size = 9, xmin = 110, xmax = 180, ymin = 0.80)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.