Learn R Programming

chronicle (version 0.3)

add_table: Add a table to a chronicle report

Description

Add a table to a chronicle report

Usage

add_table(
  report = "",
  table,
  table_title = NULL,
  title_level = 2,
  html_table_type = c("DT", "kable"),
  table_params = NULL,
  fig_width = NULL,
  fig_height = NULL
)

Arguments

report

Character string containing all the R Markdown chunks previously added. Default is '', an empty report.

table

data.frame to print on the report.

table_title

title of the table. Default is no title.

title_level

Level of the section title of this plot (ie, number of # on Rmarkdown syntax.)

html_table_type

Either print a knitr::kable table or a DT htmlwidget.

table_params

A named list of additional parameters to be passed to either knitr::kable() or DT::datatable(), depending on html_table_type

fig_width

Width of the figures printed from this code.

fig_height

Height of the figures printed from this code.

Value

An R Markdown file as a character string, now containing a chunk for the specified table.

Examples

Run this code
# NOT RUN {
html_report <- add_table(table = iris,
                         table_title = 'Iris measures',
                         html_table_type = 'kable')
cat(html_report)
# }

Run the code above in your browser using DataLab