add_ggplot: Add ggplot into a document object

View source: R/add_ggplot.R

add_ggplotR Documentation

Add ggplot into a document object

Description

Add ggplot into a document object

Usage

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

Arguments

mydoc

A document object

code

R code for table

top

top position of plot

Value

a document object

Examples

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)

cardiomoon/rrtable documentation built on March 14, 2023, 10:39 p.m.