r - 在 ggsurvplot 上更改主题 - 错误:不知道如何将 ggtheme 添加到绘图中
问题描述
我在 surv_rate 中有必要列的数据。这就是我正在运行的,它基于以下示例:http: //www.sthda.com/english/rpkgs/survminer/reference/ggsurvplot.html
fit2 <- survfit(Surv(YearsToStatus, VitalStatus) ~ PR_statusIndex + HER2_statusIndex + ER_statusIndex,
data = surv_rate)
ggsurv <- ggsurvplot(fit2, data = surv_rate, ggtheme = theme_bw)
我收到此错误:
Error: Don't know how to add ggtheme to a plot
我尝试这样做的原因是ggsurv
图中没有显示网格线。
提前感谢您可以给我的任何帮助,另外作为参考,我对 R 相当陌生。
解决方案
主题必须像在ggplot2中那样编写为函数,因此主题名称需要以一对括号结尾。
ggtheme = theme_bw()
推荐阅读
- java - 如何从不同的活动向 RecyclerView 添加开关布局?
- c# - WebAPI 过滤器的 ActionExecutedContext 中的异常属性为空
- intellij-idea - Intellij 有办法在 Kotlin 中生成构建器类吗?
- haskell - 字符串的 Haskell 函数头作为函数的输入
- c# - 在 Open Id Connect 事件期间提示用户提供其他信息?
- php - PHP:如何更改依赖于另一个变量的变量?(新手的东西)
- puppet - 应用 puppetdb 模块时遇到问题
- elasticsearch - 在 ElasticSearch 中按多个字段搜索确切的短语
- android - 如何使用 MediaColumns#IS_PENDING 将 Base64 编码的图像保存到图库
- doctrine-orm - 月代中的学说2实体编号