So I made a ggplot using a survifit curve.
Wolcurves <- survfit(Surv(Days, Survival) ~ Wol, data = DCV_noPBS)
IFB_plot <- ggsurvplot(Wolcurves, data = DCV_noPBS,
line = c(2, 1),
pval = "p-value = 0",
xlab = "Time in days",
ylab = "Proportional survival",
break.time.by = 1,
break.y.by = 0.2,
legend.labs = c("w1118wMel-Tet", "w1118wMel"))
I came up against this error with the following code.
ggsave(filename = "results/IFB2.pdf", plot = IFB_plot,
width = 12, height = 10, dpi = 1000, units = "cm")
Error in UseMethod("grid.draw") : no applicable method for 'grid.draw' applied to an object of class "c('ggsurvplot', 'ggsurv', 'list')"
It works fine if I don't specify the plot argument and just save default most recent plot.