0

次のコードでフォレスト プロットを作成しようとしていますが、うまくいきません。

tabletext<-cbind(c("Study", "2.1", "27", "30.1", "40",NA,"Summary"), c("Events", "4", "5", "1", "14",NA,NA), c("Totals", "32", "10", "8", "28",NA,NA), c("LO", "-1.95", "0.00", "-1.95", "0.00",NA,"-0.85")) 

cochrane_from_meta<-structure(list(mean=c(NA,-1.95, 0.00, -1.95, 0.00,NA,-0.85), lower=c(NA,-2.99, -1.24, -4.04, -0.74,NA,-1.96), upper=c(NA,-0.90, 1.24, 0.15, 0.74,NA,0.27)), .Names=c("mean", "lower", "upper"), row.names=c(NA, -11L),class="data.frame")

 forestplot(tabletext, cochrane_from_meta, new_page=TRUE, clip=c(0.1, 2.5), xlog=TRUE, is.summary=c(TRUE, TRUE, rep(FALSE,5), TRUE), col=fpColors(box="royalblue", line="darkblue", summary="royalblue"))

同じエラー メッセージが表示され続けます。

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

どんな助けでも大歓迎です!

編集:

プロットを次のようにしたいと思います。

ここに画像の説明を入力

最初の回答のコードから生成されたグラフは次のとおりです。

ここに画像の説明を入力

4

1 に答える 1

1

ここでは、次の構文が機能します。

cochrane_from_rmeta <- 
structure(list(
mean  = c(NA, NA, 0.578, 0.165, 0.246, 0.700, 0.348, 0.139, 1.017, NA, 0.531), 
lower = c(NA, NA, 0.372, 0.018, 0.072, 0.333, 0.083, 0.016, 0.365, NA, 0.386),
upper = c(NA, NA, 0.898, 1.517, 0.833, 1.474, 1.455, 1.209, 2.831, NA, 0.731)),
.Names = c("mean", "lower", "upper"), 
row.names = c(NA, -11L), 
class = "data.frame")

どういうわけか機能:

 prFpConvertMultidimArray(mean)

変換するオブジェクトの種類に非常にうるさいです。

于 2016-03-24T11:35:40.287 に答える