TFtest: Test logical expressions

View source: R/TFtest.R

TFtestR Documentation

Test logical expressions

Description

Check if logical expressions return what you expect with a truth table

Usage

TFtest(..., na = TRUE)

Arguments

...

Expression(s) with logical operators to be evaluated, with single letters for variables. Each expression is to be separated with a comma

na

Logical: should NAs be included in the truth table? DEFAULT: TRUE

Details

This is a nice way to check operator precedence, see Syntax

Value

Truth table as data.frame with TRUE and FALSE (and NA) combinations

Author(s)

Berry Boessenkool, berry-b@gmx.de, Mrz 2016

See Also

logical

Examples

TFtest(!a & !b)
TFtest(!a & !b, a&b, !(a&b))
TFtest(!a & !b | c)
TFtest(!a & !b | c, na=FALSE)
TFtest(!a)
TFtest(a&b|c, (a&b)|c, a&(b|c), na=FALSE) # AND has precedence over OR
TFtest(a|b, xor(a,b), na=FALSE)


berryFunctions documentation built on May 29, 2024, 4:01 a.m.