Description Usage Arguments Details Value Note See Also Examples
A generic function that can be used to draw forest plots.
1  | 
matrix | 
 Either an object of class   | 
... | 
 Other arguments.  | 
Currently, object x can come from functions 
metaDF2Matrix.metabinDF 
or metaDF2Matrix.metacontDF.
None
The code for drawMeta() generic function is based on Thomas Lumley's 
forestplot() function in the rmeta package.
drawMeta.metabinM,
drawMeta.metacontM
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52  | ### simple example
library(meta)
data(Olkin95)
meta1 <- metabin(event.e, n.e, event.c, n.c, data = Olkin95, 
                 subset = c(41,47,51,59), sm = "RR", method = "I")      
Data <- meta2DF(meta1)                 
matrix <- metaDF2Matrix(Data)                          
drawMeta(matrix)
### confidence interval plot customisations
drawMeta(matrix,
         plotCol = 2,
         refLine = log(2),
         boxSize = 0.75,
         plotWidth = unit(2,"inches"), 
         plothead = "Relative risk (log scale)")
                        
### illustrative example
meta1 <- metabin(event.e, n.e, event.c, n.c, data = Olkin95, 
                 subset = c(41,47,51,59), sm = "RR", method = "I")
### testing 'add' argument
add <- list(test1 = c(1:4), test2 = c(5:8))          
Data <- meta2DF(meta1, title = "Thrombolytic Therapy" , 
                    rowOrder = "effect", decreasing = TRUE,
                    add = add)               
matrix <- metaDF2Matrix(Data,  
                        order = c("study", "event.e", "event.c", "effect", 
                                  "ci", "w.fixed", "w.random"),     
                        roundCols = c("effect" = 2, "w.fixed" = 1, 
                                      "w.random" = 1),
                         hgap = c(2, 8, 11), 
                         newCols = list(ci = makeCIDesc("e.lower",
                                                        "e.upper",
                                                         2, c("[", "]"))))
drawMeta(matrix, 
         plotCol = 6,
         clip = log(c(0.05,6)),                   
         xlab = c("Favours treatment","Favours control"),
         plotHead = "Relative risk (log scale)", 
         plotPar = metaPar(box = list(fill = "royalblue", col = "royalblue"),
                           lines = list(col = "darkblue"),
                           diamond = list(fill = "royalblue",
                                          col = "royalblue"),
                           title = list(cex = 2))) 
### customising graphical objects using grid.edit()
### use grid.ls() to find name of component to edit
grid.edit("[.]X51[.]", global = TRUE, grep = TRUE,
          gp = gpar(col = "red"))      
downViewport("Graph")
grid.rect(gp = gpar(lty = 5))
upViewport()
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.