I get the error message when running on RStudio Server (2025.09.0 Build 387) with R v4.5.1
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
library(survival)
library(ggsurvfit)
#> Loading required package: ggplot2
lung <- lung %>%
mutate(
status = case_match(
status,
1 ~ 0, # censored
2 ~ 1, # event
)
)
survfit2(Surv(time, status) ~ 1, data = lung) |>
ggsurvfit() +
labs(
x = "Days",
y = "Overall survival probability"
)
#> Registered S3 methods overwritten by 'backports':
#> method from
#> as.character.Rconcordance tools
#> print.Rconcordance tools
#> Error in plot@scales: no applicable method for `@` applied to an object of class "ggplot2::ggplot"
Created on 2025-10-07 with reprex v2.1.1
I get the error message when running on RStudio Server (2025.09.0 Build 387) with R v4.5.1
Created on 2025-10-07 with reprex v2.1.1