# NOT RUN {
#START_TAG_TEST
# Create a FlexTable object with first 10 lines of data.frame mtcars
# add row.names as first column
MyFTable = FlexTable( data = mtcars[1:10, ]
, add.rownames=TRUE
)
# modify the text formatting properties for the row.names column
MyFTable[ , 1] = textProperties( font.style="italic", font.size = 9)
# align text to right for the row.names column
MyFTable[ , 1] = parProperties( text.align = "right" )
# change cell formatting properties for various columns
MyFTable[ c(3,6:9), c( "mpg", "disp"
, "hp", "drat", "wt", "qsec" ) ] = cellProperties( background.color="#CCCCCC")
# add text to elements of the column cyl
MyFTable[, "cyl", text.properties = textProperties(
vertical.align="superscript", font.size = 9) ] = " miles/gallon"
#STOP_TAG_TEST
# }
Run the code above in your browser using DataCamp Workspace