Cell Key Perturbation
Overview
Provides functions to generate frequency tables and apply cell key perturbation to protect against statistical disclosure in tabular outputs. The implemented methods are described in "Cell Key Perturbation User Guide" https://github.com/ONSdigital/cell-key-perturbation-R/blob/main/documentation/SML_UserDoc_CKP_R.md. Developed at the UK Office for National Statistics.
Major Changes
- Functionality to create perturbed table using BigQuery including validation process
to be able to work with large datasets in a Google Cloud Platform environment.
- Generate record keys from ons_id as default where ons_id exists, with an option to turn it off.
Minor improvements and bug fixes
- Created functions to generate sample microdata, ptable_10_5, and random record
keys for testing purposes, with alternative parameters allowed.
The sample microdata included in this package is identical to the sample in the python
version (cell-key-perturbation).
However, a new sample of microdata created in R with the same parameters would not be
identical to the sample in python, due to differences in Random Number Generation.
- Validation moved to a separate module with improved and additional validation checks.
Show all changes in 3.0.0Hide the rest of the changes in 3.0.0
- **Tabulation with missing values:** Missing values will be included in the frequency table,
treating missingness as a category. Added a check function for missing values in tabulation variables,
which returns a warning message if any of the tabulation variables contains missing values
and suggests to consider removing them.
- Re-ordered columns and standardised the data type for output tables.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK7 OK2026-05-29
Documentation
- Help pages
- 11 (1 internal)
- Examples that run
- 100%6 run in a plain check (4 of them under a condition)
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- 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
- 62
- Median days to close, 50 most recently updated closed PRs
- 2
Stars over time
6 development-tooling and community-health practices detected across 5 families in the upstream repository
Checks run against github.com/onsdigital/cell-key-perturbation-r on 2026-10-21.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
Show all practicesHide 1 practice
Dependencies
Installing cellkeyperturbation adds 1 package (1 with compiled code, 5.7 MB of source tarballs). Heaviest: data.table 5.7 MB.
Code & Tests
Datasets
People & History
- 3.0.0Latest2026-05-28 · current release
- RR 4.6.0 released · 2026-04-24
Package metadata
- First published
- 2026-05-28
- Total releases
- 1 / 1 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 3.5.0
- Bundled data
- 13 KB / 2 files
- Download size
- 54 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("cellkeyperturbation")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.