[R] help with rmeta package

Luca Braglia lbraglia at gmail.com
Sat Apr 21 17:28:01 CEST 2012


Dear R users,

I'm trying figuring out with forest plot and rmeta. Here's my code...


library(rmeta)

tabletext <- structure(c("", NA, "Sex", "[F]", "[M]", NA,
                         "Age class", "(0,60]", "(60,80]", NA,
                         "Karnofsky class", "[70;90]",
                         "(90;100]", NA, "Tumor dimension",
                         "(0,5]", "(5,10]", "(10,30]", NA,
                         "Primary tumor", "[T1]", "[T2]",
                         "[T3a]", "[T3b-T3c]", NA, "Histology",
                         "[ClearCell]", "[Papill-Chromo]",
                         "[Others]", NA, "Grading", "[G1]",
                         "[G2]", "[G3]", "[G4]", NA, "n", NA, NA,
                         "105", "198", NA, NA, "161", "142", NA,
                         NA, "39", "264", NA, NA, "121", "143",
                         "39", NA, NA, "131", "51", "68", "53",
                         NA, NA, "242", "34", "19", NA, NA, "53",
                         "136", "68", "16", NA, "HR", NA, NA,
                         "0.67", "0.92", NA, NA, "0.6", "0.98",
                         NA, NA, "1.19", "0.72", NA, NA, "1.19",
                         "0.5", "1.11", NA, NA, "0.82", "1.16",
                         "0.56", "1.21", NA, NA, "0.82", "0.5",
                         "0.95", NA, NA, "0", "0.52", "0.96",
                         "1.17", NA, "95 CI", NA, NA,
                         "[0.31-1.44]", "[0.53-1.62]", NA, NA,
                         "[0.31-1.18]", "[0.53-1.82]", NA, NA,
                         "[0.44-3.21]", "[0.43-1.21]", NA, NA,
                         "[0.42-3.41]", "[0.27-0.93]",
                         "[0.44-2.76]", NA, NA, "[0.28-2.46]",
                         "[0.39-3.46]", "[0.26-1.25]",
                         "[0.53-2.76]", NA, NA, "[0.49-1.37]",
                         "[0.06-4.31]", "[0.27-3.39]", NA, NA,
                         "[0-Inf]", "[0.25-1.1]", "[0.44-2.07]",
                         "[0.31-4.38]", NA, "P-value", NA,
                         "0.46", NA, NA, NA, "0.3", NA, NA, NA,
                         "0.39", NA, NA, NA, "0.21", NA, NA, NA,
                         NA, "0.63", NA, NA, NA, NA, NA, "0.85",
                         NA, NA, NA, NA, "0.22", NA, NA, NA, NA,
                         NA), .Dim = c(36L, 5L))

m <- c(NA, NA, NA, 0.67, 0.92, NA, NA, 0.6, 0.98, NA, NA, 1.19,
       0.72, NA, NA, 1.19, 0.5, 1.11, NA, NA, 0.82, 1.16, 0.56, 1.21,
       NA, NA, 0.82, 0.5, 0.95, NA, NA, 0, 0.52, 0.96, 1.17, NA)

l <- c(NA, NA, NA, 0.31, 0.53, NA, NA, 0.31, 0.53, NA, NA, 0.44,
       0.43, NA, NA, 0.42, 0.27, 0.44, NA, NA, 0.28, 0.39, 0.26, 0.53,
       NA, NA, 0.49, 0.06, 0.27, NA, NA, 0, 0.25, 0.44, 0.31, NA)

u <- c(NA, NA, NA, 1.44, 1.62, NA, NA, 1.18, 1.82, NA, NA, 3.21,
       1.21, NA, NA, 3.41, 0.93, 2.76, NA, NA, 2.46, 3.46, 1.25,
       2.76, NA, NA, 1.37, 4.31, 3.39, NA, NA, Inf, 1.1, 2.07,
       4.38, NA)


forestplot(labeltext=tabletext,
           m=m,
           l=l,
           u=u,
           zero=1,
           clip=c(0, 3.5),
           align=c("r",rep("c",ncol(tabletext)-1)),
           xlab="Hazard Ratio",
           xlog=FALSE,
           col=meta.colors(box="royalblue",line="darkblue",
             summary="royalblue"),
           boxsize=.4
           )

Not considering for the moment a few problems with grading
section estimation, on my linux box labeltext columns overlap in the
graph produced;
is there a way to prevent this? What did i miss?


Thank you
  Luca



More information about the R-help mailing list