add_ggplot: Add ggplot into a document object

Description Usage Arguments Value Examples

View source: R/add_ggplot.R

Description

Add ggplot into a document object

Usage

1
add_ggplot(mydoc, code = "", preprocessing = "", top = 2)

Arguments

mydoc

A document object

code

R code for table

preprocessing

preprocessing

top

top position of plot

Value

a document object

Examples

1
2
3
4
5
6
7
require(rrtable)
require(ggplot2)
require(officer)
require(magrittr)
code <- "ggplot(mtcars, aes(x = mpg , y = wt)) + geom_point()"
read_pptx() %>% add_text(title="ggplot") %>% add_ggplot(code=code)
read_docx() %>% add_text(title="ggplot") %>% add_ggplot(code=code)

rrtable documentation built on April 2, 2020, 5:09 p.m.