ReporteRs (version 0.7.8)

addRScript.pptx: Add R script into a pptx object

Description

Add R script into a pptx object.

Usage

## S3 method for class 'pptx':
addRScript(doc, rscript, file, text, append = FALSE, ...)

Arguments

doc
pptx object where expressions have to be added
rscript
an object of class RScript. Not used if file or text is provided.
file
R script file. Not used if text or rscript is provided.
text
character vector. The text to parse. Not used if file or rscript is provided.
append
boolean default to FALSE. If TRUE, paragraphs will be appened in the current shape instead of beeing sent into a new shape. Paragraphs can only be appended on shape containing paragraphs (i.e. you can not add paragraphs after a FlexTable).
...
further arguments, not used.

Value

  • an object of class pptx.

Details

You have to one of the following argument: file or text or rscript.

See Also

pptx, addRScript

Examples

Run this code
doc.filename = "addRScript_example.pptx"

# set default font size to 24
options( "ReporteRs-fontsize" = 24 )

doc = pptx( title = "title" )

# add a slide with layout "Title and Content"
doc = addSlide( doc, slide.layout = "Title and Content" )

doc = addTitle( doc, "Title example 1" )
doc = addRScript(doc, text = "x = rnorm(100)
plot(density( x ) )" )

# Write the object
writeDoc( doc, file = doc.filename )

Run the code above in your browser using DataCamp Workspace