2017-08-22 5 views
0

xlog = TRUEオプションの使用について助けが必要です。xlog = TRUEの間違ったグリッド線 - Forestplot - R

指数として平均値、下限、上限、ゼロ、グリッド、クリップを指定する必要がありますが、既に指数として提供している数字の指数関数でグリッド線を描画しています。結果として、グリッド線が間違った場所にあります。

metaan <- 
    structure(list(
    mean = c(NA, NA, NA, 0.27, 0.47, 0.33, 0.69, 0.86, 0.37, 0.08, 0.44, 0.54, 0.41, NA), 
    lower = c(NA, NA, NA, 0.13, 0.12, 0.19, 0.12, 0.54, 0.17, 0.03, 0.16, 0.06, 0.29, NA), 
    upper = c(NA, NA, NA, 0.58, 1.81, 0.60, 3.97, 1.36, 0.81, 0.21, 1.25, 4.50, 0.58, NA)), 
    .Names = c("mean", "lower", "upper"), 
    row.names = c(NA, -27L), 
    class = "data.frame") 

tabletext<-cbind(
    c("", "AB class", "", "  Aminoglycosides", "  B-lactams", "  Cephalosporins", "  Fenicoles", "  Fluoroquinolones", "  Multiresistance", "  Sulphamides", "  Tetracyclines", "  Tri/Sulpha", "  Subtotal", ""), 
    c("", "OR", "", "0.27", "0.47", "0.33", "0.69", "0.86", "0.37", "0.08", "0.44", "0.54", "0.41", ""), 
    c("", "n", "", "4", "3", "2", "3", "4", "2", "3", "4", "3", "5", "")) 

xticks <- c(0.1, 0.25, 0.5, 1, 1.5, 2, 3) 

forestplot(tabletext, 
      graph.pos = 3, 
      txt_gp = fpTxtGp(label = gpar(fontsize=10)), 
      hrzl_lines = list("3" = gpar(lty=1)), 
      zero = 1, 
      line.margin = .05, 
      mean = cbind(metaan[,"mean"]), 
      lower = cbind(metaan[,"lower"]), 
      upper = cbind(metaan[,"upper"]), 
      is.summary=c(FALSE, TRUE, rep(FALSE, 9)), 
      col=fpColors(box=c("blue"), summary=c("blue")), 
      grid = structure(0.41, 
          gp = gpar(lty = 2, col = "#CCCCFF")), 
      clip=c(0.1, 3), 
      xlog=T, 
      xticks=xticks, 
      xlab="Odds ratio") 

The grid line is at the exponential of OR=0.41, instead of at OR=0.41

正しい場所(例えば-0.38、またはログ(0.41))でグリッド線を取得するためにログを提供し、私は私のように、すでにすべてのパラメータを提供する必要があり、エラーメッセージが表示されます指数関数的である。

forestplot(tabletext, 
      graph.pos = 3, 
      txt_gp = fpTxtGp(label = gpar(fontsize=10)), 
      hrzl_lines = list("3" = gpar(lty=1)), 
      zero = 1, 
      line.margin = .05, 
      mean = cbind(metaan[,"mean"]), 
      lower = cbind(metaan[,"lower"]), 
      upper = cbind(metaan[,"upper"]), 
      is.summary=c(FALSE, TRUE, rep(FALSE, 9)), 
      col=fpColors(box=c("blue"), summary=c("blue")), 
      grid = structure(-0.39, 
          gp = gpar(lty = 2, col = "#CCCCFF")), 
      clip=c(0.1, 3), 
      xlog=T, 
      xticks=xticks, 
      xlab="Odds ratio") 

Error in forestplot.default(tabletext, graph.pos = 3, txt_gp = fpTxtGp(label = gpar(fontsize = 10)), : 
    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. 

私はリストのようなグリッド番号など、試してみましたが、私はいつも同じエラーメッセージが表示されたいずれかの私は指数関数(グリッド見当違い)またはログとして(エラーメッセージ)として番号を提供する場合。

私は何が間違っているのでしょうか、正しい場所にグリッド線を得るための方法が他にあるのだろうかと思います。

ありがとうございます。

Magda

答えて

0

解決済み。 012パッケージバージョンをGitHubからアップデートし、正しい数字を得ました。 :)

関連する問題