This function creates a DT::datatable object with default settings for
horizontal scrolling (scrollX = TRUE) and no table controls (dom = "t").
It supports input data of types data.table or DFrame.
Additional options and arguments can be passed to customize the table further.
Usage
generate_datatable(
tab,
options = list(scrollX = TRUE, dom = "ftip"),
width = "100%",
col_to_round = NULL,
digits = 3,
...
)Arguments
- tab
A dataset to be displayed in the datatable. Must be of class
data.tableorDFrame.- options
A list of options to customize the DataTable. Defaults to
list(scrollX = TRUE, dom = "ftip")- to display the search box, the table itself, information about the number of rows and pagination- width
A character string specifying the width of the table. Defaults to "100%".
- col_to_round
A character vector with the names of the columns whose values should be rounded.
- digits
A numeric value indicating the number of decimal places to be used for rounding
- ...
Additional arguments passed to
DT::datatable.
Value
A DT::datatable object.
Author
Bartosz Czech czech.bartosz@external.gene.com
Examples
generate_datatable(data.table::data.table(iris))