Learn R Programming

tables (version 0.9.31)

toTinytable: Convert tabular object to tinytable format.

Description

Converts the output of the tabular and related functions to a format consistent with the output of the tt function, so that it can be customized using the tinytable package.

Usage

toTinytable(table, ...)

Value

An object of class tinytable, suitable for passing to functions in the tinytable package. These tables can be exported to several formats, including LaTeX, HTML, Markdown, Word, Typst, PDF, and PNG.

Arguments

table

An object of class tabular.

...

Additional arguments to pass to tt.

See Also

tinytable-package

Examples

Run this code
if (requireNamespace("tinytable")) {

  tab <-  tabular( (Species + 1) ~ (n=1) + Format(digits=2)*
          (Sepal.Length + Sepal.Width)*(mean + sd), data=iris )
  tab <- toTinytable(tab, theme = "striped")
  tab <- tinytable::style_tt(tab, i = 1:2, background = "teal", color = "white")
  tab

}

Run the code above in your browser using DataLab