add_Rcode {rrtable}R Documentation

Make a R code slide into a document object

Description

Make a R code slide into a document object

Usage

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

Arguments

mydoc

A document object

code

A character string encoding R codes

format

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

Value

a document object

Examples

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

[Package rrtable version 0.3.0 Index]