英文:
'yaml_body' is not an exported object from 'namespace:xfun'
问题
我正在尝试为心脏数据集中的患者运行Kaplan-Meier曲线,该数据集是R中生存包的一部分,使用以下模型。每当我尝试运行代码时,我都会收到下面的错误消息。
错误:'yaml_body' 不是 'namespace:xfun' 的导出对象
以下是我正在运行的模型的代码。
model1 <- survfit(Surv(year, event) ~ surgery, data = heart)
summary(model1)
以下是我用于绘制Kaplan-Meier曲线以及相应错误的代码。
ggsurvplot(
model1,
pval = TRUE,
conf.int = TRUE,
risk.table = TRUE,
ggtheme = theme_bw(),
surv.median.line = "hv",
palette = c("blue", "#FF0000")
)
错误:'yaml_body' 不是 'namespace:xfun' 的导出对象
英文:
I am trying to run a Kaplan-Meier curve for patients in the Heart dataset that is part of the survival package in R using the model below. Whenever I try to run the code, I am receiving the following error below.
Error: 'yaml_body' is not an exported object from 'namespace:xfun'
Below is the code for the model I am running.
model1 <- survfit(Surv(year, event) ~ surgery, data = heart)
summary(model1)
Below is the code I am using to plot the Kaplan-Meier curve and the corresponding error.
ggsurvplot(
model1,
pval = TRUE,
conf.int = TRUE,
risk.table = TRUE,
ggtheme = theme_bw(),
surv.median.line = "hv",
palette = c("blue", "#FF0000")
)
Error: 'yaml_body' is not an exported object from 'namespace:xfun'
答案1
得分: 3
尝试安装最新版本的'xfun'包。
英文:
Try to install the newest version of the 'xfun' package
答案2
得分: 1
去工具,安装包,然后在包中输入xfun。
英文:
Go to tools, install packages and type xfun in package
答案3
得分: 0
我也遇到过这个问题,并发现是因为删除了 risk.table
,ggsurvplot
才能正常工作。我还没有找到使用 ggsurvplot
生成带风险表的图表的方法。
英文:
I also come across this issue, and I found it was due to the risk.table
that ggsurvplot
worked after being deleted. I have not found a way to generate a plot with risk table using ggsurvplot
yet.
答案4
得分: 0
根据@Flip和@Reeshu的建议,对我来说重新安装“xfun”包起作用了。
我首先手动卸载了xfun包:
但后来只需安装“xfun”包就解决了我所有的问题。
我正在使用R.4.2.2。
英文:
As @Flip and @Reeshu sugested, it worked for me reinstall "xfun" package.
I had first to uninstall manually the xfun package :
But later just install the package "xfun" solved all my issues.
I am working with R.4.2.2.
答案5
得分: 0
我最近在使用quarto文档中的gt包生成表格时遇到了相同的问题。重新安装xfun包并在渲染文档之前加载它解决了这个问题。
英文:
I recently had the same issue while generating tables using gt package in a quarto document.
Reinstalling the xfun package and loading it before rendering the document fixed the issue.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论