addTable.RTF: Insert a table into the RTF document

Description Usage Arguments Author(s) See Also Examples

Description

Insert a table into the RTF document.

Usage

1
2
3
4
## S3 method for class 'RTF'
addTable(this, dat, col.widths=NULL, col.justify=NULL, header.col.justify=NULL,
  font.size=NULL, row.names=FALSE, NA.string="-", space.before=NULL, space.after=NULL,
  ...)

Arguments

this

An RTF object.

dat

A matrix, data frame, or table.

col.widths

A vector of column widths in inches. optional.

col.justify

A single value or vector of column justifications ('L', 'R', 'C', or 'J' for Left, Right, Center, and Justify, respectively). optional.

header.col.justify

A single value or vector of table header column justifications ('L', 'R', 'C', or 'J' for Left, Right, Center, and Justify, respectively). optional.

font.size

Font size in points. optional.

row.names

Boolean argument to include row names in tables. optional.

NA.string

A character string to replace NA values in the table.

space.before

Space before each row (in inches). optional.

space.after

Space after each row (in inches). optional.

...

Not used.

Author(s)

Michael E. Schaffer

See Also

For more information see RTF.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
 rtf<-RTF("test_addTable.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))

 tab<-table(iris$Species,floor(iris$Sepal.Length))
 names(dimnames(tab))<-c("Species","Sepal Length")
 addTable(rtf,tab,font.size=10,row.names=TRUE,NA.string="-",col.widths=c(1,rep(0.5,4)) )

 done(rtf)
 

rtf documentation built on March 26, 2020, 7:40 p.m.