Description Usage Arguments Value Examples
Add two ggplots into a document object
1 2 3 4 5 6 7 8 9 | add_2ggplots(
mydoc,
plot1,
plot2,
preprocessing = "",
width = 3,
height = 2.5,
top = 2
)
|
mydoc |
A document object |
plot1 |
An R code encoding the first ggplot |
plot2 |
An R code encoding the second ggplot |
preprocessing |
preprocessing |
width |
plot width in inches |
height |
plot height in inches |
top |
top plot position in inches |
a document object
1 2 3 4 5 6 7 8 | require(ggplot2)
require(magrittr)
require(officer)
require(rvg)
plot1 <- "ggplot(data = iris, aes(Sepal.Length, Petal.Length)) + geom_point()"
plot2 <- "ggplot(data = iris, aes(Sepal.Length, Petal.Length, color = Species)) + geom_point()"
read_pptx() %>% add_text(title="Two ggplots") %>% add_2ggplots(plot1=plot1,plot2=plot2)
read_docx() %>% add_text(title="Two ggplots") %>% add_2ggplots(plot1=plot1,plot2=plot2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.