I am currently working on a shiny app. This app generates ggsurvplot
and I want to export them in a .docx report to avoid screenshots.
When I'm adding the ggsurvplot
in my report with the function body_add_gg()
i got this message error : inherits(value, "gg") is not TRUE
.
I would like to know if I can incorporate ggsurvplot
objects in my report with officeR or if I should create a classic R plot
.
I tried to directly change the class of my ggsurvplot
with class(p) <- "gg"
. But it's doesn't work(which is pretty obvious). ggsurvplot
and ggplot
objects are not exactly made in the same way, so just modifying the class name can't work.
I thank you in advance for your help.