Statistical Disclosure Control Methods for Anonymization of Data and Risk Estimation

Data from statistical agencies and other institutions are mostly confidential. This package (see also Templ, Kowarik and Meindl (2017) ) can be used for the generation of anonymized (micro)data, i.e. for the creation of public- and scientific-use files. The theoretical basis for the methods implemented can be found in Templ (2017) . Various risk estimation and anonymisation methods are included. Note that the package includes a graphical user interface (Meindl and Templ, 2019 ) that allows to use various methods of this package.

Build Status Coverage Status CRAN Downloads Mentioned in Awesome Official Statistics

sdcMicro is an R-package to anonymize microdata. Most functionalities of the package are also available via an interactive shiny-based graphical user interface.



  • Add versions for Stata export
  • add parameter shiny.server to sdcApp (to make it easily possible to run the app on a shiny server)
  • fixes due to new data.table version
  • improvements in sdcApp()


  • improvements in sdcApp()
  • updating dependencies due to new version of package car
  • bug in IL1 resolved. Now distiction of methods IL1 and IL1s
  • also a new gh-page ( was created


  • bugfix in sdcApp() when using R-objects as data input
  • bugfix in sdcApp() when button to perform kAnon() was "lost"
  • bugfix in sdcApp() when >= 10 keyvars were used in localSuppression
  • bugfix in sdcApp(): sort table of risky observations correctly
  • support shiny server for the GUI
  • new method kAnon_violations() returning the number of records violating k-anonymity in the sample or the population
  • fixes and improvements in parametrisation and error-handling in riskyCells()
  • minor fixes in sdc_guidelines vignette including a comment, that the guidelines have not yet been revised for sdcMicro version >= 5.0.0
  • pass (...) in writeSafeFile(..., format="csv")
  • fixes and improvements in localSuppression()


  • new default theme "IHSN" for sdcApp()
  • fixing an issue in report() where disclosure risk for original data was wrongly displayed if alpha-parameter was set
  • allow passing through of arguments in sdcApp()
  • add functions argus_rankswap() and argus_microaggregation() that use c++-code directly from mu-argus
  • bugfix in dUtility()
  • new function riskyCells() that allow to compute "unsafe cells" as in mu-argus
  • several code-optimizations and cleanup


  • improvement: show name of uploaded file in report when using sdcApp() (fixes #209)
  • correct summary statistics in GUI in case not all variables have been changed
  • fixes for file-imports of datasets containing labels (eg. stata-files)
  • allow to change computation of suda2-scores by adding a parameter to suda2()
  • use some functions (gowerD,..) from VIM
  • bugfix for special case of only one dim-variable in freqCalc()
  • bugfix for edge-cases in localSuppression()/kAnon()
  • update references and improve documentation


  • consistency improvements
  • code cleanup
  • fixes for non-ut8 encoded metadata using file import in graphical user interface
  • do not allow missing values in weight-variable
  • various small bugfixes and improvements


  • This release includes some small improvements in the graphical user interface and preperations for new major R version.


  • new argument 'excludeVars' in createSdcObj()
  • shiny-based GUI directly included in the package, can be started with sdcApp()
  • added vignette for sdcApp()
  • rewrite of function 'freqCalc()'
  • many improvements and bugfixes


  • IHSN SDC guidelines as vignette
  • cat. key variables returned as factors in extractManipData


  • show method for sdcMicroObj


  • pram bug fix


  • bug fix mafasts


  • only small bug fixes


  • new IHSN SDC Guidelines included
  • new implementation of freqCalc. Computation time is now linear with data size. Gains a lot of speed for large data sets.
  • localSuppression, measure_risk and createSdcJobj make use of new implementation of freqCalc
  • C++-Level glpk and R-Level Rglpk removed for better compatiblity with Mac
  • configure,cleanup removed and Makevars and rewritten according to Rcpp documentation
  • function microaggrGower added: microaggregation for numerical and categorical variables based on Gower distance
  • completely new report facility (knitr and brew instead of R2HTML), new class 'reportObj' which stores all info for reporting and is generate by calcReportData
  • new slot in class sdcObj for manipPramVars

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


5.6.1 by Matthias Templ, 6 months ago

Browse source code at

Authors: Matthias Templ [aut, cre] , Bernhard Meindl [aut] , Alexander Kowarik [aut]

Documentation:   PDF Manual  

Task views: Official Statistics & Survey Methodology, Official Statistics & Survey Statistics

GPL-2 license

Imports utils, stats, graphics, car, carData, rmarkdown, knitr, data.table, xtable, robustbase, cluster, MASS, e1071, tools, Rcpp, methods, ggplot2, shiny, haven, rhandsontable, DT, shinyBS, prettydoc, VIM

Suggests laeken, testthat

Linking to Rcpp

See at CRAN