2017-04-19 25 views
0

林在R中创建林图的问题。我的问题是这样的;我不断收到一条错误消息(错误在prFpConvertMultidimArray(意思):对不起并没有设法自动识别上限/下限。)这也指出了哪些边界,并且无论如何我可以自己设置边界?我的代码如下:prFpConvertMultidimArray中的错误(意思是):抱歉没有设法自动识别上限/下限。)

cochrane_meta<-structure(list(mean= c(-0.96, -0.3194, -0.2443, 0.3619, -0.412, -0.0859, 0.121, 0.096, -0.02, -0.01), lower= c(-0.969, -0.421, -0.387, 0.178, -0.489, -0.29, -0.461, -0.48, -0.104, -0.098), upper= c(-0.949, -0.209, -0.089, 0.521, -0.328, 0.126, 0.63, 0.614, 0.064, 0.078)), .Names= c("mean", "lower", "upper"), row.names= c(NA, -11L), class= "data.frame") 

tabletext<-cbind(c("", "Study Reference", "WOS:000176556700011", "WOS:000184899600023", "ZOOR13400031947", "WOS:000332479400108", "ZOOR11900034495", "WOS:000243735000023", "WOS:000182080900010 (2)", "WOS:000182080900010", "WOS:000334339000135", "WOS:000334339000135 (2)", NA, "Mean Effect Size"), c("Sample Number", "n", "250", "275", "154", "100", "411", "88", "13", "13", "547", "493", NA, NA), c("Effect Size", "r", "-0.96", "-0.3194", "-0.2443", "0.3619", "-0.412", "-0.0859", "0.121", "0.096", "-0.02", "-0.01", NA, "-0.14727")) 

森林图(tabletext,cochrane_meta,NEW_PAGE = TRUE,is.summary = C(TRUE,TRUE,代表(FALSE,10),TRUE),夹= C(-1.00,1.00 ),Xlog软件= TRUE,COL = fpColors(框= “红深蓝”,行= “darkblue”,摘要= “红深蓝”))

当我尝试设置与此代码的CI限制:

forestplot(tabletext, 
     cochrane_meta, new_page = TRUE, 
     is.summary=c(TRUE, TRUE, rep(FALSE,10),TRUE), 
     clip=c(-1.00,1.00), 
     xlog=TRUE, 
     upper = 1.0, lower = -1.0, 
     col=fpColors(box="royalblue",line="darkblue", summary="royalblue")) 

我收到了错误信息:

Error in forestplot.default(tabletext, cochrane_meta, new_page = TRUE, : 

平均值,下限和上限含有无效的列数平均值列:3下限列:上限列:

这是我第一次发布,所以任何帮助都很棒。如果需要更多信息,请告诉我。谢谢!

回答

1

我有几个错误。

第一:

Error in prFpConvertMultidimArray(mean) : Sorry did not manage to automatically identify the upper/lower boundaries. 

对于我remaned对象作为包例如:

cochrane_meta <- data.frame(
    coef = c(-0.96, -0.3194, -0.2443, 0.3619, -0.412, -0.0859, 0.121, 0.096, -0.02, -0.01), 
    low = c(-0.969, -0.421, -0.387, 0.178, -0.489, -0.29, -0.461, -0.48, -0.104, -0.098), 
    high = c(-0.949, -0.209, -0.089, 0.521, -0.328, 0.126, 0.63, 0.614, 0.064, 0.078)) 

第二:

Error in forestplot.default(tabletext, cochrane_meta, new_page = TRUE, : 

All argument values (mean, lower, upper, zero, grid and clip) should be provided as exponentials when using the log scale. This is an intentional break with the original forestplot function in order to simplify other arguments such as ticks, clips, and more. 

对于修复它我改变绘图参数:

forestplot(tabletext, cochrane_meta, new_page = TRUE, 
      is.summary=c(TRUE, TRUE, rep(FALSE,10),TRUE), 
      clip=c(-1.00,1.00), xlog=F, 
      col=fpColors(box="royalblue",line="darkblue", summary="royalblue")) 

三:

tabletext<-cbind(c("WOS:000176556700011", "WOS:000184899600023", "ZOOR13400031947", "WOS:000332479400108", "ZOOR11900034495", "WOS:000243735000023", "WOS:000182080900010 (2)", "WOS:000182080900010", "WOS:000334339000135", "WOS:000334339000135 (2)"), 
        c("250", "275", "154", "100", "411", "88", "13", "13", "547", "493"), 
        c("-0.96", "-0.3194", "-0.2443", "0.3619", "-0.412", "-0.0859", "0.121", "0.096", "-0.02", "-0.01")) 

最后情节的作品为:

Error in forestplot.default(tabletext, cochrane_meta, new_page = TRUE, : 
    You have provided 10 rows in your mean arguement while the labels have 14 rows 

然后,我在您的table.text对象中删除某些行

forestplot(tabletext, cochrane_meta, new_page = TRUE, 
      is.summary=c(TRUE, TRUE, rep(FALSE,10),TRUE), 
      clip=c(-1.00,1.00), xlog=F, 
      col=fpColors(box="royalblue",line="darkblue", summary="royalblue")) 

这是我的结果  this

希望你发现它有用

+0

工作出色,它也帮助我让我的头在我出错的地方。谢谢! – Joseph

相关问题