rtable (version 0.1.5)

as.FlexTable.xtable: get FlexTable from a xtable object

Description

Get a FlexTable object from a xtable object.

Usage

"as.FlexTable"(x, text.properties = textNormal(), format.args = list(), hline.after = getOption("xtable.hline.after", c(-1, 0, nrow(x))), padding.left = 4, padding.right = 4, ...)

Arguments

x
xtable object to get FlexTable from
text.properties
default text formatting properties
format.args
List of arguments for the formatC function. See argument format.args of print.xtable
hline.after
a vector of numbers between -1 and "nrow(x)", inclusive, indicating the rows after which a horizontal line should appear. see argument hline.after of print.xtable.
padding.left
cells paragraphs left padding - 0 or positive integer value.
padding.right
cells paragraphs right padding - 0 or positive integer value.
...
further arguments, not used.

Value

a FlexTable object

Examples

Run this code
#
data(tli)

tli.table <- xtable(tli[1:10,])
digits(tli.table)[c(2,6)] <- 0
FT = as.FlexTable( x = tli.table )
print( FT )
if( interactive() ) readline("Hit <Return> to see next FlexTable:")


align(tli.table) <- "|rrl|l|lr|"
FT = as.FlexTable( x = tli.table )
print( FT )
if( interactive() ) readline("Hit <Return> to see next FlexTable:")


fm1 <- aov(tlimth ~ sex + ethnicty + grade + disadvg, data=tli)
fm1.table <- xtable(fm1)
FT = as.FlexTable( x = fm1.table )
print( FT )
if( interactive() ) readline("Hit <Return> to see next FlexTable:")


bktbs <- xtable(matrix(1:10, ncol = 2))
hlines <- c(-1,0,1,nrow(bktbs))
FT = as.FlexTable(bktbs, hline.after = hlines )
print( FT )

Run the code above in your browser using DataLab