util_html_table function

The jack of all trades device for tables

The jack of all trades device for tables

util_html_table( tb, filter = "top", columnDefs = NULL, autoWidth = FALSE, hideCols = character(0), rowCallback = DT::JS("function(r,d) {$(r).attr('height', '2em')}"), copy_row_names_to_column = !is.null(tb) && length(rownames(tb)) == nrow(tb) && !is.integer(attr(tb, "row.names")) && !all(seq_len(nrow(tb)) == rownames(tb)), link_variables = TRUE, tb_rownames = FALSE, meta_data, rotate_headers = FALSE, fillContainer = TRUE, ..., colnames, descs, options = list(), is_matrix_table = FALSE, colnames_aliases2acronyms = is_matrix_table && !cols_are_indicatormetrics, cols_are_indicatormetrics = FALSE, label_col = LABEL, output_format = c("RMD", "HTML"), dl_fn = "*", rotate_for_one_row = FALSE, title = dl_fn, messageTop = NULL, messageBottom = NULL, col_tags = NULL, searchBuilder = FALSE, initial_col_tag, init_search, additional_init_args, additional_columnDefs )

Arguments

  • tb: the table as data.frame

  • filter: passed to DT::datatable

  • columnDefs: column specifications for the datatables JavaScript object

  • autoWidth: passed to the datatables JavaScript library

  • hideCols: columns to hide (by name)

  • rowCallback: passed to the datatables JavaScript library (with default)

  • copy_row_names_to_column: add a column 0 with rownames

  • link_variables: considering row names being variables, convert row names to links to the variable specific reports

  • tb_rownames: number of columns from the left considered as row-names

  • meta_data: the data dictionary for labels and similar stuff

  • rotate_headers: rotate headers by 90 degrees

  • fillContainer: see DT::datatable

  • ...: passed to DT::datatable

  • colnames: column names for the table (defaults to colnames(tb))

  • descs: character descriptions of the columns for the hover-box shown for the column names, if not missing, this overrides the existing description stuff from known column names. If you have an attribute "description" of the tb, then it overwrites everything and appears as hover text

  • options: individually overwrites defaults in options

    passed to DT::datatable

  • is_matrix_table: create a heat map like table without padding

  • colnames_aliases2acronyms: abbreviate column names considering being analysis matrix columns by their acronyms defined in square.

  • cols_are_indicatormetrics: logical cannot be TRUE, colnames_aliases2acronyms is TRUE. cols_are_indicatormetrics

    controls, if the columns are really function calls or, if cols_are_indicatormetrics has been set to TRUE, the columns are indicator metrics.

  • label_col: label col used for mapping labels in case of link_variables is used (that argument set to TRUE and Variables or VAR_NAMES in meta_data)

  • output_format: target format RMD or HTML, for RMD, markdown will be used in the output, for HTML, only HTML code is being generated

  • dl_fn: file name for downloaded table -- see https://datatables.net/reference/button/excel

  • rotate_for_one_row: logical rotate one-row-tables

  • title: character title for download formats, see https://datatables.net/extensions/buttons/examples/html5/titleMessage.html

  • messageTop: character subtitle for download formats, see https://datatables.net/extensions/buttons/examples/html5/titleMessage.html

  • messageBottom: character footer for download formats, see https://datatables.net/extensions/buttons/examples/html5/titleMessage.html

  • col_tags: list if not NULL, a named list(), names are names used to name a newly created column-group hide/show button, elements are column names belonging to each column groups as defined by colnames

  • searchBuilder: logical if TRUE, display a searchBuilder-Button.

  • initial_col_tag: character col_tags entry to activate initially

  • init_search: list object to initialize searchBuilder, see list("datatables.net")

  • additional_init_args: list if not missing or NULL, arguments passed to JavaScript, if searchBuilder == TRUE

  • additional_columnDefs: list additional columnDefs, can be missing or NULL

Returns

the table to be added to an rmdhtml file as htmlwidgets::htmlwidgets

See Also

util_formattable()

Other summary_functions: prep_combine_report_summaries(), prep_extract_classes_by_functions(), prep_extract_summary(), prep_extract_summary.dataquieR_result(), prep_extract_summary.dataquieR_resultset2(), prep_render_pie_chart_from_summaryclasses_ggplot2(), prep_render_pie_chart_from_summaryclasses_plotly(), prep_summary_to_classes(), util_as_cat(), util_as_integer_cat(), util_extract_indicator_metrics(), util_get_category_for_result(), util_get_colors(), util_get_labels_grading_class(), util_get_message_for_result(), util_get_rule_sets(), util_get_ruleset_formats(), util_get_thresholds(), util_sort_by_order()

  • Maintainer: Stephan Struckmann
  • License: BSD_2_clause + file LICENSE
  • Last published: 2025-03-05