Learn R Programming

rrtable (version 0.1.0)

add_2plots: Add two plots into a document object

Description

Add two plots into a document object

Usage

add_2plots(mydoc, plotstring1, plotstring2, width = 3, height = 2.5,
  echo = FALSE, top = 2)

Arguments

mydoc

A document object

plotstring1

An R code string encoding the first plot

plotstring2

An R code string encoding the second plot

width

plot width in inches

height

plot height in inches

echo

logical Whether or not show R code

top

top plot position in inches

Value

a document object

Examples

Run this code
# NOT RUN {
require(magrittr)
require(officer)
plotstring1="plot(1:10)"
plotstring2="hist(rnorm(100))"
read_pptx() %>% add_text(title="Two plots") %>% add_2plots(plotstring1,plotstring2) %>%
print(target=paste0(tempdir(),"/","demo.pptx"))
# }

Run the code above in your browser using DataLab