ReporteRs (version 0.2)

FlexTable: FlexTable

Description

Create a representation of a table. FlexTable can be manipulated so that almost any formating can be specified. It allows to insert headers and footers rows (with merged cells). Formating can be done on cells, paragraphs and texts (borders, colors, fonts, etc.)

Usage

FlexTable(data, span.columns = character(0),
    header.columns = TRUE, row.names = FALSE,
    cell_format = cellProperties(),
    par_format = parProperties(),
    text_format = textProperties())

Arguments

data

(a data.frame or matrix object) to add

span.columns

a character vector specifying columns names where row merging should be done (if successive values in a column are the same ; if data[p,j]==data[p-1,j] )

header.columns

logical value - should the colnames be included in the table as table headers. If FALSE, no headers will be printed unless you use addHeaderRow.

row.names

logical value - should the row.names be included in the table.

cell_format

default cells formatting properties for any data

par_format

default paragraphs formatting properties for any data

text_format

default texts formatting properties for any data

See Also

addFlexTable, FlexRow, FlexCell , pot, set_of_paragraphs, addFlexTable.docx , addFlexTable.pptx, addFlexTable.html

Examples

Run this code
# NOT RUN {
data( data_ReporteRs )
myFlexTable = FlexTable( data = data_ReporteRs
	, span.columns = "col1"
	, header.columns = TRUE
 , row.names = FALSE )
myFlexTable[ 1:2, 2:3] = textProperties( color="red" )
myFlexTable[ 4:5, 4:5] = parProperties( text.align="right" )
myFlexTable[ 1:2, 5:6] = cellProperties( background.color="#F2969F")
# }

Run the code above in your browser using DataCamp Workspace