Probabilistic Streaming Data Sketches
Overview
Provides an interface to the 'Apache DataSketches' (https://datasketches.apache.org/) library of streaming algorithms for approximate analytics on data too large to hold or process exactly. Sketches are compact, mergeable summaries built in a single pass over a stream that answer queries such as approximate distinct counts, quantiles and ranks, frequent items and point-frequency estimates, weighted sampling, and set membership with mathematically proven error bounds. Implements Karnin-Lang-Liberty (KLL), Relative Error Quantiles (REQ), t-Digest, HyperLogLog (HLL), Compressed Probabilistic Counting (CPC), Theta, Frequent Items, Count-Min, Array of Doubles, Variance Optimal (VarOpt), Exact and Bounded Probabilistic Proportional-to-Size (EBPPS), and Bloom filter sketches, with native serialization for interoperability with other 'Apache DataSketches' implementations.
Bug fixes
- Interrupting a long
$update()or query no longer leaks its input vector. The native loops probed for interrupts withR_CheckUserInterrupt(), which longjmps past C++ destructors and so skipped the release of cpp11's preserve token on the input; an interrupted 40M-element update pinned ~320 MB in R's precious list for the rest of the session. All 25 probe sites now usecpp11::check_user_interrupt(), which unwinds throughR_UnwindProtect. theta()andarray_of_doubles()sketches rebuilt frombytes =no longer lose their width. A compact payload does not carry the builderlg_k, and the previous fallback to the default width silently cost about an order of magnitude of accuracy on any later$merge()or union — unioning two round-trippedlg_k = 20sketches retained 4,096 entries instead of 1,048,576. The width is now recovered from the retained-entry count.
Show all changes in 0.1.1Hide the rest of the changes in 0.1.1
- Native update and query loops no longer pump the R event loop on the first element of every call.
New features
$merge()ontheta_sketchandarray_of_doubles_sketchgains anlg_kargument, matchingtheta_union()andarray_of_doubles_union(). Previously there was no way to control the width of a merge.
Error handling
- Errors originating in the C++ bridge now carry the same classed conditions as the R-level validators, so
tryCatch(datasketches_error = )catches every failure the package raises. New classes:datasketches_invalid_bytes(corrupt or truncatedbytes =payload),datasketches_empty_sketch($quantile(),$rank(),$cdf(),$pmf(),$min(),$max()on an empty sketch), anddatasketches_dead_pointer. - Printing or summarising a sketch restored with
readRDS()orload()now raises an actionable error pointing at$serialize()/bytes =, rather than reporting that the object is not a valid sketch. External pointers do not survive R's serialization; sketches must be persisted with$serialize(). - A
bytes =payload shorter than 8 bytes passed tohll()now raisesdatasketches_invalid_bytesrather thandatasketches_invalid_args, so a malformed payload has one class across all sketch families. Both classes inheritdatasketches_error.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK7 OK2026-07-10
Documentation
- Help pages
- 19 (1 internal)includes a package overview page
- Examples that run
- 100%18 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 87%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 7
- Median days to close, 50 most recently updated closed PRs
- 0
Releases over time
Issues over time
PRs over time
Commits over time
Commit identities over time
8 development-tooling and community-health practices detected across 4 families in the upstream repository
Checks run against github.com/pedrobtz/data.sketches on 2026-10-21.
The R CMD check workflow runs on Linux, macOS and Windows
GitHub Pages site last deployed 2026-09-30 · The repository has a site deploy workflow
pkgdown site last built 2026-09-24
This repository shows signs of AI coding tools.
- Claude Codefirst seen on or before 2026-06-17Seen in the repository: CLAUDE.mdNamed in .Rbuildignore: .claude, CLAUDE.mdPull request it wrote: opened by a project memberCommits: 1 by its own account · at least 11 crediting it in the message
- Gemini CLIfirst seen on or before 2026-07-18Config: a file or ignore line, not recorded which
- Claude Opus 5.56 commits · Sep 2026
- Claude Fable 5.13 commits · Sep 2026
- Claude Opus 4.81 commit · Jun 2026
- Claude Opus 51 commit · Sep 2026
Dependencies
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 0.1.1Latest
- 0.1.02026-07-09
- RR 4.6.0 released · 2026-04-24
Package metadata
- First published
- 2026-07-09
- Total releases
- 2 / 1 yrs
- License
- MIT + file LICENSE OSI
- Copyright
- See inst/COPYRIGHTS in the package
- Minimum R
- ≥ 4.1.0
- Download size
- 436 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("data.sketches")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.