rk.tinytable: Beautiful, Publication-Ready Tables for RKWard

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.


🌟 Key Features


⚠️ Note on HTML Previews vs. Exported Files: Advanced styling features—like Striped or Grid themes 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, .pdf, and .png files will beautifully retain all specific tinytable formatting and themes.


What's New in Version 0.0.1


🛠️ Dependencies

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:

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


🚀 Installation

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.


🛠️ Usage Workflow

This plugin adds its core components under the Analysis > Tables (tinytable) menu in RKWard:

1. Raw Data

Format and display subsets of your datasets directly.

2. Cross-Tabulation

Aggregate and summarize relationships between multiple variables.

3. Universal Export (The "Write Once, Export Anywhere" Engine)

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

💻 Usage

Once installed, the tools are organized under:

Analysis -> Tables (tinytable)

🎓 Learning Exercises

Follow these step-by-step examples to master the table generation tools.

1. The Summary Table (Raw Data)

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


2. The Pivot Table (Cross-Tabulation)

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


🌍 Internationalization (i18n)

The graphical interface automatically adapts to your RKWard language settings. Currently supported languages:


📝 License and Author

Author: Alfonso Cano (@AlfCano)
Email: alfonso.cano@correo.buap.mx

This project is licensed under the GPL (>= 3) License.