#
# ftable example 1 -------------
mtcars_ftable = ftable(mtcars$cyl, mtcars$vs, mtcars$am, mtcars$gear,
row.vars = c(2, 4),
dnn = c("Cylinders", "V/S", "Transmission", "Gears"))
FT = as.FlexTable( x = mtcars_ftable, caption = pot("This is a caption",
textBold(color="blue") ) )
print( FT )
if( interactive() ) readline("Hit <Return> to see next FlexTable:")
# ftable example 2 -------------
FT = as.FlexTable( x = ftable(Titanic, row.vars = 1:3) )
print( FT )
if( interactive() ) readline("Hit <Return> to see next FlexTable:")
FT = as.FlexTable( x = ftable(Titanic, row.vars = 1:2, col.vars = "Survived") )
print( FT )
if( interactive() ) readline("Hit <Return> to see next FlexTable:")
FT = as.FlexTable( x = ftable(Titanic, row.vars = 2:1, col.vars = "Survived") )
print( FT )
Run the code above in your browser using DataLab