This package provides a suite of RKWard plugins that create a graphical user interface for the janitor R package. It implements a "Inspect -> Clean -> Validate" workflow, allowing users to sanitize dataframes, manage duplicates, and create publication-ready frequency tables without writing code.
This package installs a new submenu in RKWard: Data > Data Cleaning (janitor), which contains the following plugins:
Sanitize Data: Rapidly clean "dirty" dataframes imported from Excel/CSV.
remove_empty(): Remove rows and columns that are entirely missing (NA).remove_constant(): Remove columns containing a single constant value (zero variance).Manage Duplicates: A detective tool for row-level validation.
get_dupes(): Find and highlight duplicate rows based on specific ID columns.distinct(): Remove duplicates to enforce uniqueness.Frequency Tables (tabyl): A modern, pipe-friendly alternative to table().
tabyl(): Generates frequency tables and crosstabs.adorn_*() functions: Add totals, percentages, and formatting (e.g., "50.0%") with simple checkboxes.Inspect Cases: Quick diagnostics for large datasets.
head() / tail(): View the first or last N rows.slice_sample(): View a random set of N rows to sanity-check data quality.As of version 0.0.2, the interface is fully localized to match your RKWard language settings:
es)fr)de)pt_BR)janitor and dplyr.
install.packages(c("janitor", "dplyr"))
devtools (for installation from source).local({
## Preparar
require(devtools)
## Computar
install_github(
repo="AlfCano/rk.janitor"
)
## Imprimir el resultado
rk.header ("Resultados de Instalar desde git")
})
To try the examples below, you will need the penguins dataset (included in R 4.5.2+ or the palmerpenguins package) and a custom "messy" dataset.
Run this code in the RKWard console to create a dataset with errors:
# A dataset with duplicates, empty rows, and constant columns
messy_sales <- data.frame(
id = c(101, 102, 103, 101, NA),
product = c("Apple", "Banana", "Orange", "Apple", NA),
amount = c(10, 20, 15, 10, NA),
status = c("Active", "Active", "Active", "Active", NA) # Constant column
)
# Load penguins if not already loaded
data("penguins") # or library(palmerpenguins)
messy_sales.NAs is gone, and the status column (which contained only "Active" and NA) is removed.messy_sales.id and product.101 (Apple) appears twice.species (from penguins).island.Alfonso Cano Robles (alfonso.cano@correo.buap.mx)
Assisted by Gemini, a large language model from Google.