简体   繁体   English

使用ggsurplot时匹配错误(x,表,不匹配= 0L

[英]Error in match(x, table, non match =0L when using ggsurplot

My code is我的代码是

fit <- survfit(Surv(OS, DEATH) ~ high, data=datf1)

no error:没有错误:

print(fit)
      n    events  median  0.95LCL 0.95UCL
C=1  106    30      62.6     62.2    65.1
C=2  190    51      63.3     62.1    64.3

My code that generates the error我产生错误的代码

ggsurvplot(fit, pval=TRUE, conf.int=TRUE,
risk.table=TRUE, surv.median.line='hv', ylab='OS', break.x.by=5, palette=cols, 
title="P_01")
Error in match (x, table, nomatch=0L):
'match' requires vector arguments

My libraries: dplyr, survival, survminer, ggplot2, gridExtra.我的图书馆:dplyr,生存,survminer,ggplot2,gridExtra。 I have run this code on my data table with no issues.我已经在我的数据表上运行了这段代码,没有任何问题。 But today when I run the code I am having the above error issue.但是今天当我运行代码时,我遇到了上述错误问题。 I do not believe it's due to my data input.我不相信这是由于我的数据输入。

ggsurvplot(fit, risk.table=TRUE)

Interestingly when I run the above code, I get the correct KM plot with table, but I also get a warning message有趣的是,当我运行上面的代码时,我得到了正确的 KM plot 和表格,但我也收到了一条警告消息

Vectorized input to 'element_text()' is not officially supported. 
Results may be unexpected or may change in future versions of ggplot2.

Any assistance in solving this would be greatly appreciated.解决此问题的任何帮助将不胜感激。

I think it's due to the variable cols .我认为这是由于变量cols Can you try if this works:你可以试试这是否有效:

ggsurvplot(fit, pval=TRUE, conf.int=TRUE,
           risk.table=TRUE, surv.median.line='hv', ylab='OS', break.x.by=5, palette = c("blue", "red"), 
           title="P_01")

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 dcast错误:`匹配错误(x,表,nomatch = 0L)` - dcast error: `Error in match(x, table, nomatch = 0L)` 匹配错误(x,表,nomatch = 0L):“匹配”需要向量参数 - Error in match(x, table, nomatch = 0L) : 'match' requires vector arguments 修拉中的 FindVariableFeatures Function 产生“匹配错误(x,表,nomatch = 0L):'匹配'需要向量参数” - FindVariableFeatures Function in Seurat Producing “Error in match(x, table, nomatch = 0L) : 'match' requires vector arguments” 匹配错误(el,set,0L):“匹配”需要向量参数? - Error in match(el, set, 0L) : 'match' requires vector arguments? Foverlaps 错误: if (any(x[[xintervals[2L]]] - x[[xintervals[1L]]] &lt; 0L)) 中的错误停止 - Foverlaps error: Error in if (any(x[[xintervals[2L]]] - x[[xintervals[1L]]] < 0L)) stop 非等值内部联接(nomatch = 0L)是否应该是双向的? - Should non-equi inner join (nomatch=0L) be bidirectional? 尝试绘制createTreeView并获取工具中的错误::: httpdPort&gt; 0L - Trying to plot createTreeView and get the Error in tools:::httpdPort > 0L 在if(d2 == 0L)中使用cut error设置bin分组时出错{:缺少值需要TRUE / FALSE - Error in setting bin grouping using cut Error in if (d2 == 0L) { : missing value where TRUE/FALSE needed if(REML)p else 0L时出错:参数长度为零 - Error in if (REML) p else 0L : argument is of length zero Rstudio中的“工具中的错误::: httpdPort <= 0L:...”是什么意思? - What does “Error in tools:::httpdPort <= 0L : …” in Rstudio means?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM