R-package ptable
Overview
The goal of the ptable package is to produce perturbation tables that can be used for applying noise to statistical tables with the cell-key method (CKM).
Information
This package is developed within the SGA
Open source tools for perturbative confidentiality methods
. The
package contains the core-features to produce and check perturbation
tables (i.e. ptables) for frequency count and magnitude tables. The
ptables can be used for applying noise to statistical tables with any
cell-key method approach - among others either the
cellKey()-package or
TauArgus.
Feedback (via issues) with regards to bugs or features requests are very welcome as well as pull-requests.
Important Note
With Release 1.0.0 we offer a first stable version which also will be available on CRAN.
With Release 0.4.0 we offer an additional modification of ptables for frequency count data in order to receive an higher level of protection
Installation
Stable version from CRAN
A stable version of the package can directly be installed from CRAN
install.packages("ptable")
Versions under development from github
Directly (online)
Newer versions of the package can be directly installed from github
using the devtools
package which must be installed on your system
if (!require("devtools")) install.packages("devtools")
library(devtools)
# update all packages
update.packages(ask = FALSE)
# finally install the ptable package directly from github
devtools::install_github(
"sdcTools/ptable",
dependencies = c("Depends", "Imports"),
force = TRUE,
build_opts = "--build-vignettes"
)
If you experience a timeout due to a proxy server while downloading, one
can work around this issue by specifying the proxy-server using the
hhtr
package:
httr::set_config(use_proxy(url = "xxx.xxx.xxx.xxx", port = yy))
Source file (offline)
Alternatively you can download an archive (tar.gz) of the newest release here and install it manually using
install.packages('C:/Users/.../Downloads/v1.x.x.tar.gz', repos = NULL, type = 'source')
Usage
Load the package
To load the package ptable
you have to call
library(ptable)
Help & Documentation
## help file
?ptable::ptable_pkg
A detailed documentation is given in the vignette:
pt_vignette()
Graphical User Interface (GUI)
For first time users and visual learners there is a GUI. The unfinished dashboard can be started using the following command:
ptable()
The download buttons (for downloading the ptable and the graphics) only works within a browser.
Updates
The changelog is given here.
Major Change
Starting from versions
> 0.3.2
and> 0.4.1
, functionscreate_ptable()
,create_cnt_ptable()
andcreate_num_ptable()
allow to create perturbation objects for count- and/or numeric variables in one step. The required inputs to these functions are the maximum noiseD=...
and the noise varianceV=...
.In versions
<= 0.3.2
, this process was separated into two parts:
- defining parameters using
pt_create_pParams()
- creating the final perturbation outputs using
pt_create_pTable()
These steps still work in newer versions of the package differently (if necessary):
- If the argument
create
increate_ptable()
,create_cnt_ptable()
orcreate_num_ptable()
is set toFALSE
, then these functions return an object of class [ptable_params-class].- This object can be used as input in
create_ptable()
only to create the final perturbation output.
To-Dos
- Allow for special cases: extended parameter setting, i.e. improved row-wise parameter settings
- Add more sophisticated error codes
- Update test environment
- Improve accuracy of ptable by means of digits-functionality