Functions to combine data.frames in ways that require additional effort in base R, and to add metadata (id, title, ...) that can be used for printing and xlsx export. The 'Tatoo_report' class is provided as a convenient helper to write several such tables to a workbook, one table per worksheet. Tatoo is built on top of 'openxlsx', but intimate knowledge of that package is not required to use tatoo.
tatoo ("table tools") provides functions to combine data.frames in ways that
require additional effort in base R, and to add metadata (id, title, ...)
that can be used for printing and xlsx export. The 'Tatoo_report' class is
provided as a convenient helper to write several such tables to a workbook,
one table per worksheet. In addition, the Tatto_report
class is provided as a convenient helper to write several such tables to a
workbook, one table per worksheet.
# tatoo is available from CRANinstall.packages("tatoo")# Or you can install the development version from GitHub:install.packages("devtools")devtools::install_github("statistikat/tatoo")
tag_table(head(cars), tt_meta(table_id = "t1", title = "Data about cars"))mash_table(head = head(cars), tail = tail(cars), mash_method = "row")mash_table(head = head(cars), tail = tail(cars), mash_method = "col")comp_table(head = head(cars), tail = tail(cars))stack_table(head = head(cars), tail = tail(cars))
None of the examples are particularily hard to do in base R, but tatoo provides functions with a clean interface and nice print and export methods for the created objects. Please refer to the package vignette for more examples.
walk_regions()
and map_regions()
to mainuplate cells in named
regions within a Workbook
(e.g. apply formatting to them)open_file()
save_*()
functions (they wrote to the users
home directory by default)Tatoo_table
objects to Latex code or save them directly to .pdf
with as_latex()
and save_pdf()
(experimental).open_file()
utility to open files with external programs.view_pdf()
and view_xlsx()
for directly viewing tables in a .pdf
viewer or spreadsheet programsave_xlsx()
now returns the path to the saved workbook, raher than the
workbook objectprint()
methodsas_Composite_table.data.table()
converts data.tables to Composite tables,
based on separators in the column names (e.g fruit.apple, fruit.banana)as.data.table.Composite_table()
constructs column names. The new
format is colname.multiname instead of multiname.colname. This is to emulate
the behaviour of base::merge()
flip_names()
can flip names and multinames of a composite table (at the cost
of reordering the columns)