ReporteRs (version 0.5.7)

addRScript.docx: Add R script into a docx object

Description

Add R script into a "docx" object.

Usage

# S3 method for docx
addRScript(doc, file, text,
  comment.properties = textProperties(color = "#A7947D"),
  roxygencomment.properties = textProperties(color = "#5FB0B8"),
  symbol.properties = textProperties(color = "black"),
  operators.properties = textProperties(color = "black"),
  keyword.properties = textProperties(color = "#4A444D"),
  string.properties = textProperties(color = "#008B8B", font.style =
  "italic"), number.properties = textProperties(color = "blue"),
  functioncall.properties = textProperties(color = "blue"),
  argument.properties = textProperties(color = "#F25774"),
  package.properties = textProperties(color = "green"),
  formalargs.properties = textProperties(color = "#424242"),
  eqformalargs.properties = textProperties(color = "#424242"),
  assignement.properties = textProperties(color = "black"),
  slot.properties = textProperties(color = "#F25774"),
  default.properties = textProperties(color = "black"), stylename, bookmark,
  ...)

Arguments

doc

Object of class "docx" where expressions have to be added

file

R script file. Not used if text is provided.

text

character vector. The text to parse. Not used if file is provided.

comment.properties

comment txtProperties object

roxygencomment.properties

roxygencomment txtProperties object

operators.properties

operators txtProperties object

keyword.properties

keyword txtProperties object

string.properties

string txtProperties object

number.properties

number txtProperties object

functioncall.properties

functioncall txtProperties object

argument.properties

argument txtProperties object

package.properties

package txtProperties object

formalargs.properties

formalargs txtProperties object

eqformalargs.properties

eqformalargs txtProperties object

assignement.properties

assignement txtProperties object

symbol.properties

symbol txtProperties object

slot.properties

slot txtProperties object

default.properties

default txtProperties object

stylename

value of the named style to apply to paragraphs in the docx document. Expected value is an existing stylename of the template document used to create the docx object. see styles.docx.

bookmark

a character value ; id of the Word bookmark to replace by the table. optional. See bookmark.

...

further arguments, not used.

Value

an object of class "html".

See Also

docx, addRScript, bookmark

Examples

Run this code
# NOT RUN {
#START_TAG_TEST
doc.filename = "addRScript_example.docx"
# Create a new document
doc = docx( title = "title" )

doc = addRScript(doc, text = "ls()
x = rnorm(10)", stylename = "rRawOutput" )

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

Run the code above in your browser using DataCamp Workspace