From b7c4fae968640548253a0b81e3d278edf883b1af Mon Sep 17 00:00:00 2001 From: Alboukadel Kassambara Date: Tue, 29 Oct 2024 15:50:10 +0000 Subject: [PATCH] deprecated aes_string() replaced by aes() --- NAMESPACE | 2 ++ R/ggsurvplot_df.R | 2 +- R/utilities.R | 1 + man/ggsurvplot_df.Rd | 1 - 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 66e0e14..3402bea 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -53,6 +53,8 @@ importFrom(grDevices,axisTicks) importFrom(magrittr,"%>%") importFrom(methods,is) importFrom(purrr,map) +importFrom(rlang,"!!") +importFrom(rlang,sym) importFrom(rlang,syms) importFrom(stats,anova) importFrom(stats,approx) diff --git a/R/ggsurvplot_df.R b/R/ggsurvplot_df.R index 1fb6a50..5f0eb64 100644 --- a/R/ggsurvplot_df.R +++ b/R/ggsurvplot_df.R @@ -176,7 +176,7 @@ ggsurvplot_df <- function(fit, fun = NULL, #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: df[, .strata.var] <- factor( df[, .strata.var], levels = .levels(.strata), labels = legend.labs) - p <- ggplot2::ggplot(df, ggplot2::aes_string("time", "surv")) + + p <- ggplot2::ggplot(df, ggplot2::aes(x = !!sym("time"), y = !!sym("surv"))) + ggpubr::geom_exec(surv.geom, data = df, size = size, color = color, linetype = linetype, ...) + ggplot2::scale_y_continuous(breaks = y.breaks, labels = scale_labels, limits = ylim, expand = .expand) + ggplot2::coord_cartesian(xlim = xlim)+ diff --git a/R/utilities.R b/R/utilities.R index 9049585..ebd5818 100644 --- a/R/utilities.R +++ b/R/utilities.R @@ -10,6 +10,7 @@ #' @importFrom stats pchisq #' @importFrom survMisc ten comp #' @importFrom utils capture.output +#' @importFrom rlang !! sym # Count the number of ggplots in a list diff --git a/man/ggsurvplot_df.Rd b/man/ggsurvplot_df.Rd index f0e22eb..8d64341 100644 --- a/man/ggsurvplot_df.Rd +++ b/man/ggsurvplot_df.Rd @@ -111,7 +111,6 @@ censors. Default value is "+" (3), a sensible choice is "|" (124).} \item{censor.size}{numveric value specifying the point size of censors. Default is 4.5.} - \item{title}{main title} \item{xlab}{x axis label}