Reconstruct Raw Data from Summary Statistics
Overview
Reconstructs all possible raw data that could have led to reported summary statistics. Provides a wrapper for the 'Rust' implementation of the 'CLOSURE' algorithm.
This could easily be the first major version of unsum because it contains many new features, but also many breaking changes – you may need to adjust your code if you have used unsum before. However, it does not yet rise to the level where I can promise a stable API, so it is officially a minor release.
I do not think this is an ideal versioning model, and future releases will not follow it. The current release became necessary due to a combination of breaking changes in upstream dependencies and increasingly strict CRAN policies. Thanks to all maintainers of this crucial infrastructure.
Caveat
I have become more cautious about the inferences allowed by CLOSURE (and SPRITE) than I was at the time of the 0.2.0 release. Users are advised to exercise caution when using these methods and drawing conclusions based on them. Forensic metascience methods generally require validation, and there is still much work to be done on both of these methods. There are plans to conduct this work in the future.
Big picture
This version unifies and consolidates the system of CLOSURE functions and remodels its output to include much new information. It also moves the horns index calculation down to the Rust level, where it is now conducted alongside CLOSURE itself. Their results are returned together. This reaffirms the central status of closure_generate(): every other function that uses CLOSURE results can now immediately follow up on closure_generate(), without any intermediaries.
The other big change is SPRITE support. SPRITE is also implemented in Rust and generally mirrors CLOSURE in its output and API.
Another focus of this release is visualization, with new plotting functions and improvements on existing ones.
New features
- SPRITE is now implemented in unsum. It is centered around
sprite_generate()and features downstream visualization functions, such assprite_plot_bar(). closure_count_all()returns the total number of samples CLOSURE will find without running CLOSURE itself. Useful to assess the complexity of future runs, but not yet used to its full potential.demo_plot_bar()can be used to showcase principles of reconstruction methods and the horns index by using arbitrary example distributions.
Show all changes in 0.3.0Hide the rest of the changes in 0.3.0
- Modified
closure_generate()'s output to incorporate the horns index values for each generated sample, summary statistics about them, and frequencies based on the minimal and maximal horns index values. - Added writing mode in
closure_generate()via the newpathargument. This allows you to save large data to disk immediately, preventing a risk of data loss. - Added a
techniquecolumn at the start ofclosure_generate()'s output. This is for clarity: it says"CLOSURE"here, and the output of any technique to be implemented in the future will be disambiguated in the same way. - Added
closure_plot_horns_histogram()to visualize the distribution of horns index values as a whole.
Breaking changes
- CLOSURE (and SPRITE) output is now an S7 object that is essentially a list of tibbles. You can access it like other tibbles, but manipulation is intentionally restricted to preserve authenticity of results.
- Reworked
closure_plot_ecdf(): - It now shows 3 lines by default — overall mean, min horns index, and max horns index
(samples = "mean_min_max"), with a legend that includes the horns index values of each category. The old default wassamples = "mean"for a single line and no legend. - Accordingly, the
line_colorargument was replaced byline_color_singleandline_color_multiple. - The
padargument is now a string with three alternatives. - Added
legend_titleandmark_decimalarguments. - Remodeled
closure_plot_bar()to show two panels instead of one. It now compares the subsets of samples with minimal and maximal variability, as measured byhorns(). Itsformatargument now defaults to"percent"rather than"absolute-percent", for readability. It also gained new arguments to control the new two-panel layout:min_max,overlay,facet_labels, andfacet_labels_parens. - Redesigned
closure_read()to control which parts are read in via the newincludeandsamples_caparguments. - Renamed the
frequencyargument ofclosure_plot_bar()toformat, for clarity. There are many mentions of "frequency" in unsum, so it is good to disambiguate. In particular, the newdemo_plot_bar()hasfreqsas its first argument. - Renamed the
"absolute-percent"option offormat(the formerfrequency) inclosure_plot_bar()to"absolute_percent", for consistency with other multi-word strings in the package. - Removed
closure_horns_analyze(). Its functionality was integrated intoclosure_generate()for simplicity and ease of use. - Removed
closure_horns_histogram()because its functionality has now been replaced byclosure_plot_horns_histogram(). - Removed the
rounding_error_meanandrounding_error_sdarguments fromclosure_generate(). They are not needed for users. If anything, you can use theroundingargument instead. - Also removed the
warn_if_emptyargument fromclosure_generate(). It did not fulfill much of a purpose.
Bugfixes
- Fixed a bug that caused
closure_plot_ecdf()to return clearly wrong results if the scale did not start at 1. - Fixed bugs in
closure_plot_bar()that could cause imprecision in the ways that percentages were rounded for display usingfrequency = "percent"orfrequency = "absolute-percent"(see above for new syntax). This was only intended to limit the length of the percentage text labels, but it could affect the bar sizes, as well. - Fixed a mismatch between
closure_write()andclosure_read(): the two disagreed about which files make up a results folder, so writing results and reading them back in again failed.
Lifecycle updates
- The package now requires ggplot2 version 3.4.0 or later and ggtext.
- The package no longer depends on readr.
- New dependencies: S7, ggtext, grid, and stats. (The last two are standard packages.)
- Updated the Rust dependency on extendr to version 0.9.0, which no longer calls the non-API entry point
R_NamespaceRegistry.
From NEWS.md in the release
Install
Health
- OK13 OK2026-10-13
- NOTE12 OK, 1 NOTE2026-10-12
- OK13 OK2026-10-08
- NOTE12 OK, 1 NOTE2026-10-07
- OK13 OK2026-10-02
Show 9 earlier changesHide 9 earlier changes
- NOTE12 OK, 1 NOTE2026-10-01
- OK13 OK2026-09-23
- NOTE12 OK, 1 NOTE2026-09-19
- OK13 OK2026-09-10
- NOTE4 OK, 9 NOTE2026-06-09
- ERROR4 OK, 8 NOTE, 1 ERROR2026-06-08
- NOTE8 OK, 6 NOTE2026-04-14
- ERROR13 OK, 1 ERROR2026-03-16
- OK14 OK2026-03-10
Documentation
- Help pages
- 12
- Examples that run
- 92%11 run in a plain check · 1 never run
- Exported functions with examples
- 100%
- Documented parameters
- 80%
- Return-value docs
- 100%
- Help pages citing references
- 8%
- Get started HTML
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 82
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Issues over time
PRs over time
Commits over time
13 development-tooling and community-health practices detected across 6 families in the upstream repository
Checks run against github.com/lhdjung/unsum on 2026-10-11.
GitHub Pages site last deployed 2026-10-04 · The repository has a site deploy workflow
pkgdown site last built 2026-10-04
Show all practicesHide 2 practices
This repository shows signs of AI coding tools.
- Claude Codefirst seen 2026-02-24Seen in the repository: .claudeNamed in .Rbuildignore: .claudePull request it wrote: opened by a project memberCommits: at least 7 crediting it in the message
- Claude Sonnet 4.64 commits · Mar 2026
- Claude Opus 5.53 commits · Oct 2026
Dependencies
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 0.3.0Latest2026-09-04 · current release · diff ↗ ·
removed 2 exports
closure_horns_analyze, closure_horns_histogramadded 7 exports
closure_count_all, closure_plot_horns_histogram, demo_plot_bar, sprite_generate, sprite_plot_bar, sprite_read, sprite_write - RR 4.6.0 released · 2026-04-24
- 0.2.02025-06-19
- RR 4.5.0 released · 2025-04-11
Package metadata
- First published
- 2025-06-19
- Total releases
- 2 / 1 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 4.2.0
- Download size
- 8.5 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("unsum")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
The repository also keeps a CITATION.cff.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-18, which the citation names so these numbers can be found later. More on citing and the projects behind them.