Learn R Programming

infix (version 0.1.0)

funlogic: Function Logical Operators

Description

Creates a function which returns the corresponding logical operation between what f1 and f2 return.

Usage

f1 %&% f2

f1 %|% f2

f1 %xor% f2

Arguments

f1, f2

Arbitrary predicate functions.

Details

To obtain the logical negation of what a function f returns, use base function Negate.

Examples

Run this code
# NOT RUN {
is.null.na <- is.null %|% is.na
all(is.null.na(NA), is.null.na(NULL)) # returns TRUE
# }

Run the code above in your browser using DataLab