Learn R Programming

OpasnetUtils (version 1.1.0)

interpret: Parse human readable distribution definitions

Description

Interpret textual data into probability distributions using regular expressions.

Usage

interpret(idata, N = NULL, rescol = "Result", dbug = FALSE, ...)

Arguments

idata
input, character or data.frame
N
number of iterations
rescol
name of result column, defaults to "Result"
dbug
use TRUE to turn on debug prints
...
excess arguments are ignored

Value

  • Returns a data.frame with an "Iter" column added. Uninterpretable values are converted to NAs.

Details

Interpretation rules are as follows: Empty space is stripped away. "X-Y" defines a uniform distribution between X and Y, if Y/X is greater than 100 then logarithmic uniform distribution is assumed. Negative X and Y are determined by the number of "-": if 2, X is negative; if 3, both are. "http://en.opasnet.org/w/Interpret for a table. See also: http://en.opasnet.org/

Examples

Run this code
interpret(c("1-4", "1-1000"), N = 5)

Run the code above in your browser using DataLab