add_Rcode: Make a R code slide into a document object

Description Usage Arguments Value Examples

View source: R/add_Rcode.R

Description

Make a R code slide into a document object

Usage

1
add_Rcode(mydoc, code, preprocessing = "", format = "pptx")

Arguments

mydoc

A document object

code

A character string encoding R codes

preprocessing

A character string of R code as a preprocessing

format

desired format. choices are "pptx" or "docx"

Value

a document object

Examples

1
2
3
4
5
6
library(rrtable)
library(magrittr)
library(officer)
code="summary(lm(mpg~hp+wt,data=mtcars))"
read_pptx() %>% add_text(title="Regression Analysis") %>%
   add_Rcode(code)

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