add_Rcode: Make a R code slide into a document object

View source: R/add_Rcode.R

add_RcodeR 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)

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