Learn R Programming

cna (version 0.1-3)

condition: Facilities to inspect conditions in a truth table

Description

Facilities to inspect conditions in a truth table.

Usage

condition(x, ...)

## S3 method for class 'default': condition(x, tt, ...) ## S3 method for class 'condTbl': condition(x, tt, ...)

## S3 method for class 'cond': print(x, digits = 3, print.table = TRUE, row.names = FALSE, ...)

group.by.outcome(condlst, cases = TRUE)

Arguments

x
In condition.default a vector of character strings specifying conditions as "A+B*C -> D", where "A","B","C","D" are column names in tt. In condition.condTbl, x ist a
digits
Number of digits to print in consistencies and coverages.
print.table
Logical value specifying whether to print the truth table.
row.names, ...
In print.cond, these arguments are passed to print.data.frame.
condlst
A list of objects, each of them of class cond. As returned by condition.
cases
A logical Value. If TRUE the returned data frame has a column cases.

Value

  • condition returns a list of objects, each of them of class cond. An objects of class cond is a data frame of 0 and 1 with additional attributes.

    group.by.outcome returns a list of data frames.

Details

In condition, the expressions on both sides of the -> in the character strings defining conditions are evaluated and written into a data frame with two columns. Specific attributes are then attached to these data frames: consistency, coverage and an additional class attribute cond, among others. This yields one amended data frame for each character string, so that the value returned by cond is a list of such cond-objects.

<-> can be used instead of -> in the condition specifications, and one sided conditions with no arrow at all are admissable, too.

group.by.outcome combines the cond-data frames resulting from conditions with the same outcome (data frames with an identical second column) into a common data frame with a larger number of columns. Note that the additional attributes (consistencies etc.) are thereby removed.

See Also

A general overview of the facilities in the cna package is given in cna-package.