ggforest: forest plot base ggplot2 with the result of RunPoolEffect and...

Description Usage Arguments Details Value Author(s) Examples

Description

Polt a forest with the result of RunPoolEffect and multiVarRRTab base-on the ggplot.

Usage

1
2
3
4
ggforest(dataset, manualcolors, manualshapes, Logscale = TRUE, x, y,
  lower, upper, pointsize = 2, linesize = 0.4, errorbarhheight = 0.2,
  colorVar, shapeVar, facetx = NULL, facety = NULL, xlabs, ylabs,
  setTheme = TRUE)

Arguments

dataset

dataframe; a dataframe of result of RunPoolEffect and multiVarRRTab

manualcolors

character; the ponit colors.

manualshapes

character; the point shape.

Logscale

logical; log2 for x-axis (default) or not?

x

character; the header name in the dataframe for map to axes of point.

y

character; the header name in the dataframe for map to ayes of point.

lower

character; the header name in the dataframe for map to lower of the errorbar.

upper

character; the header name in the dataframe for map to upper of the errorbar.

pointsize

numeric; the point size, default is 3.0 .

linesize

numeric; the errorbar line size, default is 0.4 .

errorbarhheight

numeric; the errorbar height size, default is 0.2 .

colorVar

character; the header name in the dataframe for map to the color of point.

shapeVar

character; the header name in the dataframe for map to the shape of point.

facetx

character; the header name in the dataframe for map to the facet of row, default is NULL.

facety

character; the header name in the dataframe for map to the facet of col, default is NULL.

xlabs

character; label for the x-axis.

ylabs

character; label for the y-axis.

setTheme

logical; whether set the default theme.

Details

TODO

Value

Returns a ggplot object.

Author(s)

Shuangbin Xu

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
51
52
53
54
55
library("MetaMicrobiome")
data <- system.file("data", package="MetaMicrobiome", "ggforestDemo.rda")
load(data)
head(ggforestDemoData)
ggforestDemoData$study <- factor(ggforestDemoData$study, 
                               levels=rev(unique(ggforestDemoData$study)))
print(levels(ggforestDemoData$study))
pointcolors <- rev(c("#E41A1C",
                     "#4DAF4A", 
		    "#984EA3", 
		    "#FF7F00", 
		    "#FFFF33", 
		    "#A65628",
		    "#F781BF",
		    "#999999"))
pointshape <- c(18, 20)
data1 <- ggforestDemoData[ggforestDemoData$measure=="Shannon",]
head(data1)
data2 <- ggforestDemoData
head(data2)
p1 <- ggforest(dataset=data1,
      manualcolors=pointcolors,
      manualshapes=pointshape,
      x="est",
      y="study",
      Logscale=TRUE,
      lower="lower",
      upper="upper",
      colorVar="study",
      shapeVar="unite",
      pointsize=3,
      linesize=0.4,
      errorbarhheight=0.05,
      xlabs="Odds Ratio",
      ylabs="",
      setTheme=TRUE)

p2 <- ggforest(dataset=data2,
         manualcolors=pointcolors,
         manualshapes=pointshape,
         x="est",
         y="study",
         Logscale=TRUE,
         lower="lower",
         upper="upper",
         colorVar="study",
         shapeVar="unite",
         pointsize=3,
         linesize=0.4,
         errorbarhheight=0.05,
         xlabs="Odds Ratio",
         ylabs="",
         facetx="measure",
         facety="group",
         setTheme=TRUE)

xiangpin/MetaMicrobiome documentation built on May 26, 2019, 2:34 a.m.