metaDF2Matrix.metabinDF: Convert 'metacontDF' Objects to Matrices

Description Usage Arguments Details Value See Also Examples

Description

A function that converts 'metabinDF' objects into a character matrix used for plotting.

Usage

1
2
3
4
5
6
7
## S3 method for class 'metabinDF'
metaDF2Matrix(df,
             order, newCols = NULL, roundCols = NULL,
             stats = list(hetero = makeStatsDesc(labelNames =
                                                 c("I2", "tau2", "p"))),
             groupStats = NULL, newLabel = NULL,
             colNames, groupLab, hgap = NULL, vgap, drop, ...)

Arguments

df

An object of class 'metabinDF'.

newCols

A list of new columns made from existing columns in the data frame. Can use functions makeCIDesc and makeMSDDesc to combine and round columns.

order

A vector of column names in the order that it should appear in the matrix.

roundCols

A named vector with values of rounding to the nearest decimal place of specified column names.

colNames

A vector of column names for the ordered matrix.

hgap

A vector of row numbers to add horizontal spaces.

vgap

A vector of column numbers to add vertical spaces.

stat

A list of descriptions or strings for heterogeneity statistics. Can use the functions makeStatsDesc and makeLabelDesc to make descriptions that specify format and select relevant statistics.

...

Not used.

Details

Rounding can be applied using the roundCols argument for all numeric columns except for the confidence interval column which must be done through the newCols argument using the makeCIDesc function.

Value

An object of class 'metabinM' and 'metaM' with following list of components:

Matrix

A matrix set out as to be drawn in the forest plot.

PlotDF

A data frame with plotting information for drawing the confidence interval graph.

See Also

meta2DF.metabin, drawMeta.metabinM

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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, title = "Thrombolytic Therapy",
                rowOrder = "effect", decreasing = TRUE)
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), vgap = 5,
                        newCols = list(ci = makeCIDesc("e.lower", "e.upper",
                                                        2, c("[", "]"))))
matrix

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