%xor% {infixit} | R Documentation |
XOR infix operator
Description
This is a logical operator that implements XOR. (Exclusive or).
Usage
lhs %xor% rhs
Arguments
lhs |
The left-hand side(s). |
rhs |
The right-hand side value(s). |
Details
The XOR truth-table is as follows:
LHS | RHS | Value |
TRUE | TRUE | FALSE |
TRUE | FALSE | TRUE |
FALSE | TRUE | TRUE |
FALSE | FALSE | FALSE |
In contrast with the standard OR, XOR evaluates to FAlSE if both arguments are TRUE.
Value
An atomic value or vector the same length as the left-hand side input.
Examples
{
TRUE %xor% TRUE # Evaluates to FALSE
FALSE %xor% TRUE # Evaluates to TRUE
}
[Package infixit version 0.3.1 Index]