Learn R Programming

rtf (version 0.4.1)

addTable.RTF: Add a table to the RTF document

Description

Add a table to the RTF document.

Usage

## S3 method for class 'RTF':
addTable(this, dat, col.widths=NULL, font.size=NULL, row.names=FALSE, NA.string="-", ...)

Arguments

this
An RTF object.
dat
A matrix, data frame, or table.
col.widths
A vector of column widths in inches optional.
font.size
Font size in points optional.
row.names
Boolean argument to include row names in tables optional.
NA.string
A character to replace NA values in the table.
...
Not used.

Value

  • The new name (invisible).

See Also

For more information see RTF.

Examples

Run this code
rtf<-RTF("test.rtf.doc",width=8.5,height=11,font.size=10,omi=c(1,1,1,1))
 addTable(rtf,as.data.frame(head(iris)),font.size=10,row.names=FALSE,NA.string="-",
          col.widths=rep(1,5))
 done(rtf)

Run the code above in your browser using DataLab