ReporteRs (version 0.5.5)

[<-.FlexTable: modify FlexTable content

Description

add text into a FlexTable object or Format content of a FlexTable object

Usage

## S3 method for class 'FlexTable':
[(x, i, j, text.properties, newpar = F, byrow = FALSE) <- value

Arguments

See Also

addHeaderRow, addFooterRow , FlexTable, setFlexTableBorders , spanFlexTableRows, spanFlexTableColumns , setRowsColors, setColumnsColors, setZebraStyle , addFlexTable, addFlexTable.docx , addFlexTable.pptx, addFlexTable.html

Examples

Run this code
# 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"

Run the code above in your browser using DataLab