Skip to content

Commit

Permalink
Merge pull request #18 from tenderle/master
Browse files Browse the repository at this point in the history
Update Readme.md
  • Loading branch information
tenderle authored Dec 4, 2018
2 parents 766efe1 + b0669be commit 5651991
Showing 1 changed file with 60 additions and 93 deletions.
153 changes: 60 additions & 93 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,66 @@ This package is developed within the SGA `Open source tools for perturbative con

We have a first rough version with which interested users may play around. Feedback (via issues) with regards to bugs or features requests are very welcome as well as pull-requests.

### Installation

The package can directly be installed from `github` using the `devtools` package which must be installed on your system

``` r
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:

``` r
httr::set_config(use_proxy(url="xxx.xxx.xxx.xxx, port=yy))
```
### Usage
#### Load the package
To load the package `ptable` you have to call
``` r
## load the package
library(ptable)
```
#### Help
``` r
## help for specifying the perturbation parameters
?pt_create_pParams
## help for producing the perturbation table
?pt_create_pTable
```
#### Documentation
Once finished, the package will also contain a package **vignette**. The unfinished introduction vignette can be looked at using the following command:
``` r
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:
``` r
ptable()
```
The download buttons (for downloading the ptable and the graphics) only works within a browser.
### News
#### ToDo's
Expand Down Expand Up @@ -80,96 +140,3 @@ We have a first rough version with which interested users may play around. Feedb
#### Version 0.1.0
- first uploaded version

### Installation

The package can directly be installed from `github`

``` r
devtools::install_github("sdcTools/ptable", build_vignette=TRUE)
```

### Usage

#### Load the package

To load the package `ptable` you have to call

``` r
## load the package
library(ptable)
```

#### Help

``` r
## help for specifying the perturbation parameters
?pt_create_pParams

## help for producing the perturbation table
?pt_create_pTable
```

#### Basic Example

This is a basic example which shows you how to solve a common problem with `D=3` (maximum deviation) and `V=0.7` (perturbation variance):

``` r
## basic example code
params <- pt_create_pParams(D=3, V=0.7)
ptable_destatis <- pt_create_pTable(params = params, type="destatis")
ptable_abs <- pt_create_pTable(params = params, type="abs")
```

#### Extended Example (prevent small frequencies)

To prevent small frequencies (e.g. 1s and 2s) in perurbed frequency tables, you can set the treshold parameter `js=...` when specifying the perturbation table (i.e. all positive integers less equal `js` are no target frequencies for the perturbation and, hence, blocked):

``` r
## extended example code
params <- pt_create_pParams(D=5, V=3, js=2)
ptable_destatis <- pt_create_pTable(params = params, type="destatis")
```

#### Extended Example (prevent small frequencies and pre-setting of probabilities)

Additionally, you can pre-set the probability that original frequencies won't be perturbed using the parameter `pstay=...`. In the following example the probability that values shouldn't be perturbed is pre-set to 50%:

``` r
## extended example code
params <- pt_create_pParams(D=5, V=3, js=2, pstay=0.5)
ptable_destatis <- pt_create_pTable(params = params, type="destatis")
```

However, a pre-set probability does neither hold for blocked frequencies (small frequencies such as 1s and 2s) nor for original zeroes. The probabilites for blocked frequencies are always `0` (i.e. they must be perturbed) and for original zeroes the probability is always `1` (i.e. zeroes won't be perturbed).

#### Plot the perturbation table and save the plot

``` r
## plot the ptable
fifi_plot(ptable_destatis)
## ... and save the plot as pdf
fifi_plot(ptable_destatis, file="graph.pdf")

## Perturbation Panel
fifi_plot(ptable_destatis, type="p")
## Transition Matrix
fifi_plot(ptable_destatis, type="t")
```

#### Export the perturbation table (e.g. for importing the file in tauargus)

``` r
pt_export(ptable_destatis,file="Test")
```

### Dashboard (experimental status)

To try the dashboard just call

``` r
## start the dashbaord
ptable()
```

The download buttons (for downloading the ptable and the graphics) only works within a browser.

0 comments on commit 5651991

Please sign in to comment.