Learn R Programming

rrtable (version 0.1.0)

add_Rcode: Make a R code slide into a document object

Description

Make a R code slide into a document object

Usage

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

Run this code
# NOT RUN {
library(rrtable)
library(magrittr)
library(officer)
code="summary(lm(mpg~hp+wt,data=mtcars))"
read_pptx() %>% add_text(title="Regression Analysis") %>%
   add_Rcode(code) %>% print(target=paste0(tempdir(),"/","test.pptx"))
# }

Run the code above in your browser using DataLab