How an AI-Assisted R Workflow Turned Kampala Waste Data Into a Citable Package

Oct 20, 2026 813 views

A spreadsheet can become a research publication in a day when the workflow treats documentation, validation and review as part of the data work. That’s the practical lesson from solidwastekampala, an R package built from household waste measurements in Kampala, Uganda. The package reached version 1.0.0 with a Zenodo DOI after roughly three hours of human work across four sessions, with an AI coding assistant handling much of the implementation.

The result includes validated data from 103 households, a dictionary covering 37 variables, CSV and XLSX exports, package documentation, a website, machine-readable metadata and a citation listing the authors’ ORCID iDs. The repository also retains the prompts, plans, issues, pull requests and commits behind the work, making the process inspectable alongside the data.

The spreadsheet needed more than cleanup

The source workbook came from a study of domestic solid waste in Kampala. Field teams weighed and sorted household waste over seven days in three parishes representing different income levels: Bwaise I (low), Bukoto I (middle) and Ggaba (high). The research appeared as “Quantity and composition of domestic solid waste in Kampala City as influenced by socioeconomic factors,” by Katukiza et al. at Makerere University. It was published in Frontiers in Environmental Science in September 2026.

Like many field data files, the workbook mixed records with presentation and analysis. Its sheets included two rows of merged headers, summary rows, derived values beside raw observations and manual-entry errors. One cell recorded metals in Ggaba as 2..674. Excel’s SUM formula skipped that text value without warning, even though it affected totals used to calculate daily, per-person values and density.

The first work session began on 22 July 2026, when the repository contained an empty R package and the Excel workbook. The initial instruction to Claude Code was to inspect the data and propose a plan before writing cleanup code. That sequencing mattered: the first session produced decisions about what the workbook contained and how to preserve its history, rather than an early script that might silently make assumptions.

Inspection established that only three sheets contained raw observations; the remaining sheets held derived results. Parish averages of 0.43, 0.53 and 0.98 kilograms of waste per person per day matched the paper’s headline figures, confirming which sheets to process. The plan set a preservation rule: keep values as recorded, document known inconsistencies and test for them rather than quietly correcting them.

Small issues made the work reviewable

On the next session, the plan became a series of GitHub issues, each limited to a step that could be reviewed independently. Work stopped for human review before each commit. By 06:55, the processing script read every sheet as text so that import would not discard or reinterpret values. It assigned consistent names to the 37 columns, corrected the malformed numeric cell and repaired two malformed household IDs.

Category labels were harmonized through explicit maps. For example, IIIiterate became Illiterate, and Unpaced became Unpaved. The script then checked the output against known properties of the workbook. In 99 of 103 rows, the waste category sums matched the recorded totals; the script identifies the four exceptions. Seven workbook inconsistencies were documented and tested for, with no unrecorded edits.

This approach makes the cleaning choices part of the package’s reproducible logic. The script is plain R code, and the resulting data can be regenerated without an AI tool. That distinction matters for anyone maintaining or reusing the package: an assistant helped create the workflow, but the processing steps remain executable and inspectable on their own.

The first pull request, merged at 07:19, added the cleaned data, CSV and XLSX files, and the dictionary. A second pull request followed at 08:03 with the materials needed to use and cite the package: metadata, documentation, a README that reproduces a figure from the paper, a website and schema.org metadata.

Review added checks beyond the script

Openwashdata packages are reviewed against a versioned standard. For this release, the standard was version 1.0.0, applied through four checklist issues and four corresponding pull requests. The sequence covered metadata and citation, data content and processing, documentation, then tests and automated checks. The pull requests merged at 12:22, 12:58, 13:52 and 14:50, respectively.

The metadata review found five co-author ORCID iDs in the public registry. Two matches were uncertain, so the team asked the lead author to confirm them. The exchange later supplied a missing identifier and resolved the spelling of a name; the corrections were applied across the metadata files.

The data review reran the processing script and reproduced the committed files byte for byte. The final review step added automated checks across five platforms, reporting zero errors, zero warnings and zero notes. Together, these checks cover more than whether the R code runs: they test whether the data can be recreated and whether the package meets its publishing requirements.

At 00:15 on 24 July, version 1.0.0 was released. Three minutes later, Zenodo issued the DOI. The repository’s release record therefore traces a short but structured path from an unprocessed workbook to a package that can be cited and retrieved independently.

A package designed for discovery and reuse

The package’s DOI, 10.5281/zenodo.21519796, resolves to the latest version. Its project website and schema.org metadata provide additional routes to discovery. Readers can access the data as an R package, CSV or XLSX files, or as a Zenodo archive that does not depend on GitHub.

For reuse, the package supplies a dictionary for all 37 variables, including units, and a processing script that reproduces the data. Tidy records, consistent names, ordered factors for categories and UTF-8 files support exchange with other tools. The source inconsistencies are documented, and the data are released under a CC BY 4.0 licence. Version 1.0.1, dated 17 September, carries ORCID iDs for all eight authors.

The repository also records how the package was assembled. Its prompts/ directory archives every prompt, while plans/ stores the plans; commit messages point back to the prompts behind the work. This record gives maintainers and readers a way to follow the decisions that shaped the files, rather than seeing only the final output.

AI sped up production, while people owned the decisions

Claude Code, using the Claude Fable 5 model, wrote the processing script, dictionary, documentation and metadata from the author’s prompts. The repository contains 11 prompts through release, and 14 of its 39 commits made by 24 July include an Assisted-by line naming the model. The author reviewed and merged all eight pull requests, managed the author correspondence and chose how names should appear.

That division of work is a useful model for data teams considering AI-assisted production. The assistant can take on repeatable implementation across scripts and package files, while the human reviewer checks the source, evaluates exceptions and decides what is ready to publish. Here, the recorded prompt and commit history makes those responsibilities visible, and the ordinary R script keeps the finished data independent of the assistant.

The author also used AI to draft this account. Claude Fable 5 produced an initial version on 24 July using repository records; Claude Opus 5.5 revised and shortened it on 7 and 8 October. The author selected the claims and checked the dates and numbers against the repository. The prompts, commits and published account are public, so readers can compare the disclosure with the underlying record.

Data cleaning was only one part of the effort. The dictionary, documentation, citation, metadata, author review and reproducibility checks turned the workbook into something others can find, assess and use. With small reviewable tasks and a clear standard, those publication steps fit into a day—and the repository leaves a trail that can guide the next dataset through the same process.

The solidwastekampala package was published by openwashdata with funding from the Open Research Data Program of the ETH Board. The data come from Katukiza et al. at Makerere University. Explore the package at openwashdata.github.io/solidwastekampala.

Source: Lars Schöbitz · www.r-bloggers.com

Comments

Sign in to comment.
No comments yet. Be the first to comment.

Related Articles

From a raw spreadsheet to a published data package in a day