[R] unable to get barchart of censored subjects from ggsurvplot() in survminer package, if there is no predcitor
Ivan Krylov
|kry|ov @end|ng |rom d|@root@org
Thu Jun 20 18:49:23 CEST 2024
В Mon, 17 Jun 2024 15:53:16 -0400
"Christopher W. Ryan via R-help" <r-help using r-project.org> пишет:
> Caused by error:
> ! Unknown colour name: strata"
> about "uknown colour name strata"
> ## but there are no strata
rlang::last_trace() demonstrates that the error happens because some
code receives a string 'strata' and tries to decode it as a name of a
colour:
farver::decode_colour('strata')
# Error: Unknown colour name: strata
This appears to originate from the first layer of the ncensor.plot:
p <- ggsurvplot(
fit,
data = lung,
xlab = "Time in days",
ncensor.plot = TRUE
)
p$ncensor.plot$layers[[1]]$aes_params
# $colour
# [1] "strata"
#
# $fill
# [1] "strata"
This can be traced further but I'm not sure how to fix the bug without
strata. Giving an explicit argument color = 'black' to ggsurvplot()
results in a warning but at least doesn't raise an error while drawing
the plot.
--
Best regards,
Ivan
More information about the R-help
mailing list