DescTools (version 0.99.11)

WrdR: Insert a R Command and It's Output in a Word Document

Description

Insert an R Command and It's Output in Word document. Helpful for documenting tasks.

Usage

WrdR(x, wrd = getOption("lastWord"))

Arguments

x
R command as text to be evaluated.
wrd
the pointer to a word instance. Can be a new one, created by GetNewWrd() or an existing one, created by GetCurrWrd(). Default is the last created pointer stored in getOption("lastWord").

Details

The command text will be placed in a Word document and formatted in italics. The result will be written in bold fontface.

See Also

WrdText

Examples

Run this code
# Windows-specific example
wrd <- GetNewWrd()
WrdR("sapply(iris[,-5], mean)", wrd=wrd)

Run the code above in your browser using DataCamp Workspace