50% off: Unlimited data and AI learning.
State of Data and AI Literacy Report 2025

tabxplor (version 1.1.0)

tab_kable: Print a tabxplor table in html

Description

Print a tabxplor table in html

Usage

tab_kable(
  tabs,
  theme = c("light", "dark"),
  color_type = NULL,
  html_24_bit = NULL,
  tooltips = TRUE,
  popover = NULL,
  ...
)

Arguments

tabs

A table made with tab or tab_many.

theme

By default, a white table with black text, Set to "dark" for a black table with white text.

color_type

Set to "text" to color the text, "bg" to color the background. By default it takes getOption("tabxplor.color_style_type").

html_24_bit

Should specific 24bits colors palettes be used ? Default to getOption("tabxplor.color_html_24_bit")

tooltips

By default, html tooltips are used to display additional informations at mouse hover. Set to FALSE to discard.

popover

By default, takes getOption("tabxplor.kable_popover"). When FALSE, html tooltips are of the base kind : they can't be used with floating table of content in pkgrmarkdown documents. Set to TRUE to use kableExtra html popovers instead, which are compatible with floating toc. Remember to enable the popover module by copying the following code into your document : <script> $(document).ready(function(){ $('[data-toggle="popover"]').popover(); }); </script> You can then use a css chunk in rmarkdown to change popovers colors.

...

Other arguments to pass to knitr::kable and kableExtra::kable_styling.

Value

A html table (opened in the viewer in RStudio). Differences from totals, confidence intervals, contribution to variance, and unweighted counts, are available in an html tooltip at cells hover.

Examples

Run this code
# NOT RUN {
tabs <- tab(forcats::gss_cat, race, marital, year, pct = "row", color = "diff")
tab_kable(tabs, theme = "light", color_type = "text")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab