From edac04699596f7792b3a40ff709b535b85cc62fe Mon Sep 17 00:00:00 2001 From: Teun van den Brand Date: Thu, 18 Jan 2024 21:52:53 +0100 Subject: [PATCH] Avoid missing or unexported object error --- R/add_highlight.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/add_highlight.R b/R/add_highlight.R index 7460d382..771d28d9 100644 --- a/R/add_highlight.R +++ b/R/add_highlight.R @@ -86,7 +86,8 @@ add_highlight.ggsurvfit <- function(gg = NULL, gg_gb <- ggplot2::ggplot_build(gg) if ("get_guide_data" %in% getNamespaceExports("ggplot2")) { - strata_labels <- ggplot2::get_guide_data(gg_gb, "colour")$.label + get_guide_data <- get("get_guide_data", asNamespace("ggplot2")) + strata_labels <- get_guide_data(gg_gb, "colour")$.label } else { gg_gtable <- ggplot2::ggplot_gtable(gg_gb) gg_guidebox_id <- base::which(base::sapply(