util_html_table: The jack of all trades device for tables

View source: R/util_html_table.R

util_html_tableR Documentation

The jack of all trades device for tables

Description

The jack of all trades device for tables

Usage

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,
  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
)

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))

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

Value

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

See Also

util_formattable()


dataquieR documentation built on July 26, 2023, 6:10 p.m.