A Powerful GUI Wrapper for the tinytable Package Bringing Elegant Data Tables to RKWard
rk.tinytable provides a seamless, point-and-click interface for creating, styling, and exporting beautiful, publication-ready tables directly within RKWard. This plugin leverages the highly versatile tinytable package, allowing users to generate complex cross-tabulations or format raw data into stunning tables with zero R code.
Zero-Code Table Generation: Create professional tables directly from RKWard's GUI without writing a single line of R script.
Intuitive Interface: Cleanly organized tabbooks for data selection, content (titles/notes), numeric formatting, styling, and file export.
Advanced Cross-Tabulations: Easily calculate Counts, Means, or Sums across multiple variables. Includes automatic Sturges-rule binning for numeric variables.
Automatic Margins (Totals): Easily append Row and Column totals to your cross-tabulations. Totals are automatically calculated via dplyr and intelligently formatted with bold text using tinytable styling. (Note: Automatically disabled when calculating Means to prevent invalid math).
Interactive HTML Previews: Features an isolated HTML rendering engine with injected Bootstrap CSS to preview tables accurately inside RKWard before exporting.
Comprehensive Customization: Control column alignments, numeric formats (Scientific, Percentage), decimal places, themes (Grid, Striped, Empty), and custom NA replacements.
Universal Export: Save tables seamlessly into multiple formats including Word (.docx), HTML, PDF, PNG, Markdown, LaTeX, and Typst.
Multilingual Ready: Fully prepared for translation into English, Spanish, French, German, and Portuguese (Brazil).
⚠️ Note on HTML Previews vs. Exported Files: Advanced styling features—like
StripedorGridthemes and specific column alignments—are heavily optimized for compiled backend engines (pandoc,webshot2,typst). While the live HTML preview inside RKWard uses a generalized Bootstrap layout to ensure rendering stability (which may override some inline CSS), your final exported.docx,.pngfiles will beautifully retain all specifictinytableformatting and themes.
tinytable package.srcdoc iframes.This plugin relies on the following R packages. RKWard will attempt to load them automatically, but you may need to install them if they are missing from your system:
tinytable, dplyr, tidyr
webshot2 (Required for PNG exports)pandoc (Required for Word/Markdown exports)install.packages(c("tinytable", "dplyr", "tidyr", "pandoc", "webshot2"))
(Note: A local installation of Pandoc is required by R to export tables to formats like .docx and .pdf).
You can install this plugin directly from GitHub using remotes or devtools inside your RKWard console:
# Install the plugin
library("remotes")
# install_github("AlfCano/rk.tinytable")
install.packages("rk.tinytable", repos = c('https://alfcano.r-universe.dev', 'https://cloud.r-project.org'))
Once installed, restart RKWard to ensure the new menu entries and translations appear correctly.
This plugin adds its core components under the Analysis > Tables (tinytable) menu in RKWard:
Format and display subsets of your datasets directly.
drop_na), select specific columns, or aggregate basic numeric means.Aggregate and summarize relationships between multiple variables.
(Note: Advanced features like stripes and specific alignments are heavily optimized for compiled outputs like Word, PDF, and PNG. The live HTML preview in RKWard utilizes a generalized Bootstrap layout for speed and compatibility).
Once installed, the tools are organized under:
Analysis -> Tables (tinytable)
Follow these step-by-step examples to master the table generation tools.
Scenario: We want a clean, publication-ready table showing the average characteristics of cars based on their cylinder count.
A. Data Preparation (Run in Console):
# Load built-in dataset and make cylinders a factor
my_cars <- mtcars
my_cars$cyl <- as.factor(my_cars$cyl)
B. Plugin Settings (tinytable - Raw Data):
my_cars
cyl, mpg, hp, wt
Checked (Calculates Means of numeric columns)1
/path/to/save/Car_Summary.docx
Scenario: Analyzing the survival rates of Titanic passengers by Class and Sex.
A. Data Preparation (Run in Console):
# Use the built-in Titanic dataset (convert to flat dataframe)
titanic_df <- as.data.frame(Titanic)
# Expand the frequencies back into raw rows for realistic cross-tabulation
titanic_raw <- titanic_df[rep(1:nrow(titanic_df), titanic_df$Freq), 1:4]
B. Plugin Settings (tinytable - Cross-Tabulation):
titanic_raw
Class, Sex
Survived
Count (Frequencies / N)
Striped
Center (c)
/path/to/save/Titanic_Survival.pdf
The graphical interface automatically adapts to your RKWard language settings. Currently supported languages:
Author: Alfonso Cano (@AlfCano)
Email: alfonso.cano@correo.buap.mx
This project is licensed under the GPL (>= 3) License.