gg.plotHolder: gg.plotHolder

Description Usage Arguments Value Examples

View source: R/fRedsRutils.R View source: R/C-3PR_ASCII.R

Description

gg.plotHolder

gg.plotHolder

Usage

1
2
3
gg.plotHolder(useArial = F, afmPATH = "~/Dropbox")

gg.plotHolder(useArial = F, afmPATH = "~/Dropbox")

Arguments

useArial

Use the Arial font (requires .afm font files in the afmPath)

afmPATH

Path to Arial .afm font files.

useArial

Use the Arial font (requires .afm font files in the afmPath)

afmPATH

Path to Arial .afm font files.

Value

A blank ggplot2 object that can be used in concordance with grid.arrange.

A blank ggplot2 object that can be used in concordance with grid.arrange.

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
56
57
58
59
60
61
62
63
64
65
66
67
# Create a plot with marginal distributions.
library(ggplot2)
library(scales)

df <- data.frame(x = rnorm(n = 100), y = rnorm(n = 100),
                 group = factor(sample(x=c(0,1),
                 size = 100, replace = TRUE))
                 )

scatterP <- ggplot(df, aes(x = x, y =y, colour = group)) +
            geom_point() +
            gg.theme()

xDense <- ggplot(df, aes(x = x, fill = group)) +
          geom_density(aes(y= ..count..),trim=FALSE, alpha=.5) +
          gg.theme("noax") +
          theme(legend.position = "none")

yDense <- ggplot(df, aes(x = y, fill = group)) +
          geom_density(aes(y= ..count..),trim=FALSE, alpha=.5) +
          coord_flip() +
          gg.theme("noax") +
          theme(legend.position = "none")

library(gridExtra)

grid.arrange(xDense,
             gg.plotHolder(),
             scatterP,
             yDense,
             ncol=2, nrow=2,
             widths=c(4, 1.4), heights=c(1.4, 4)
             )

# Create a plot with marginal distributions.
library(ggplot2)
library(scales)

df <- data.frame(x = rnorm(n = 100), y = rnorm(n = 100),
                 group = factor(sample(x=c(0,1),
                 size = 100, replace = TRUE))
                 )

scatterP <- ggplot(df, aes(x = x, y =y, colour = group)) +
            geom_point() +
            gg.theme()

xDense <- ggplot(df, aes(x = x, fill = group)) +
          geom_density(aes(y= ..count..),trim=FALSE, alpha=.5) +
          gg.theme("noax") +
          theme(legend.position = "none")

yDense <- ggplot(df, aes(x = y, fill = group)) +
          geom_density(aes(y= ..count..),trim=FALSE, alpha=.5) +
          coord_flip() +
          gg.theme("noax") +
          theme(legend.position = "none")

library(gridExtra)

grid.arrange(xDense,
             gg.plotHolder(),
             scatterP,
             yDense,
             ncol=2, nrow=2,
             widths=c(4, 1.4), heights=c(1.4, 4)
             )

ManyLabsOpenScience/manylabRs documentation built on April 12, 2018, 8:22 p.m.