A reference object of reference class refObjTable
assumes
that a table simply consists of a tabel header and a table body.
Those components are represented by the fields of the reference class.
Apart from the initialisation method, the getter and setter methods
for the table header, we have a method to add additional rows to
the existing table body. The two methods to_knitr_kable
and
to_pander_pandoc
write tables in markdown format using
functions knitr::kable()
and pander::pandoc.table()
sTableHeader
vector of table headers
lTableBody
list of table body
addRow(plTableRow)
Adding a row represented by a list to the body of the table. The list representing the row must have the same names as the existing table body, otherwise, the row is not added to the table body.
getTableHeader()
Getter for table header
initialize()
Initialisation of table with empty body.
setTableHeader(psTableHeader)
Setter for table header
to_knitr_kable()
Output current table in markdown format using function knitr::kable(). In case the length of the specified table header is consistent with the number of columns, then the table header is added as columnnames of the data.frame representation of the table body.
to_pander_pandoc(psStyle = "rmarkdown", psJustify = NULL,
pnSplitCells = 30)
Output current table in markdown format using the function pander::pandoc.table(). This method accepts two parameters psStyle and psJustify which are passed to to pander::pandoc.table().
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.