drawMeta.metabinM: Plot Function for 'metabinM' Objects

Description Usage Arguments Details Value See Also Examples

Description

Function to create forest plots for objects of class 'metabinM'.

Usage

1
2
3
4
5
6
7
## S3 method for class 'metabinM'
drawMeta(matrix, plotCol = NCOL(matrix$Matrix) + 1, 
        plotHead = "", xlab = NULL, 
        refLine = 0, plotWidth = unit(0.3, "npc"), plotPar = metaPar(), 
        xlog = TRUE, xticks = NULL, boxSize = NULL, align = NULL, 
        clip = log(c(0.05,6)), newpage=TRUE, fit = TRUE, abbreviate = FALSE, 
        vpName = "Forest", ...)

Arguments

matrix

An object of class 'metabinM'.

plotCol

Numeric column the confidence interval graph goes into.

plotHead

Heading for the confidence interval graph.

xlab

Vector of length 2 specifying direction of effect as x-axis labels.

refLine

x-axis coordinate for no effect line.

plotWidth

Width of confidence interval graph.

plotPar

Parameters for confidence interval graph, see metaPar.

xlog

If TRUE, x-axis tick marks are exponentiated.

xticks

Optional user-specified x-axis tick marks. Specify NULL to use the defaults, numeric(0) to omit the x-axis.

boxSize

Override the default box size based on precision.

align

Vector giving alignment ("l","r","c") for columns of table.

clip

Lower and upper limits for clipping confidence intervals to arrows.

newpage

Draw plot on a new page and overwrites current device.

fit

Fit plot into current viewport.

abbreviate

Abbreviate names of graphical objects.

vpName

Name of the forest plot viewport.

...

Not used.

Details

This function is more flexible but contains fewer arguments than the forest.meta method for metabin objects in the meta package. It requires the user to first produce a dataframe using meta2DF.metabin and convert that into a text matrix using metaDF2Matrix.metabinDF. This process can be done with minimal input from the user, such that only the meta-analysis object is needed to produce the plot.

If more flexibility is required, customisations to the plot can be made at the different stages of the process. Changing the order of studies by rows and adding extra columns from external sources can be done using meta2DF.metabin. Reordering of columns and making new columns from existing columns in the data frame can be done using metaDF2Matrix.metabinDF. Changing the position of the confidence interval graph relative to the other text columns can be done in drawMeta.metabinM.

Value

None

See Also

meta2DF.metabin, metaDF2Matrix.metabinDF

Examples

 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
### 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,  
                        order = c("study", "effect", "w.random"),     
                        roundCols = c("effect" = 2, "w.random" = 1),
                        hgap = c(2, 7))                          
drawMeta(matrix,
         plotCol = 1,
         plotHead = "Relative risk (log scale)")
         
### confidence interval plot customisations
drawMeta(matrix,
         plotCol = 2,
         clip = log(c(0.05,6)),
         refLine = log(2),
         boxSize = 0.75,
         plotWidth = unit(2,"inches"), 
         plotHead = "Relative risk (log scale)")
         
### illustrative example
### 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 = 5,
         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"))) 
### 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"))                          

pmur002/metaplot documentation built on May 25, 2019, 10:21 a.m.