andor {lazy.andor}R Documentation

Generation of string infix operators

Description

Generation of string infix operators

Usage

andor(A, B)

"&"(A, B = NULL)

"|"(A, B = NULL)

"&&"(A, B = NULL)

"||"(A, B = NULL)

Arguments

A

The first argument

B

The second argument

Details

This package generates infix operators: '&', '&&', '|', '||',
which are almost equivalent to, resp, '%&%', '%&&%', '%|%', '%||%'
in the package lazy.tools.

The difference is that '&' has precedence over '|“ but '%&%“ does NOT.
Therefore, it is better to use parentheses.

See the descriptions of And, Or, and Not in the package lazy.tools.

"a" & "b" is equivalent to And( "a", "b" ) and generates "(a) & (b)".
"a" && "b" is equivalent to And( "a", "b", oper="&&" ) and generates "(a) && (b)".
"a" | "b" is equivalent to Or( "a", "b" ) and generates "(a) | (b)".
"a" || "b" is equivalent to Or( "a", "b", oper="||" ) and generates "(a) || (b)".

Note that '&' has precedence over '|“ but '%&%“ does NOT.

Use eval( parse(text=condition) ) to evaluate the expression.

To remove these operators:
detach("package:lazy.andor", unload=TRUE)

Value

a string

Examples


"a" & "b"
And( "a", "b" )
"a" | "b"
Or( "a", "b" )

"a" | "b" & "c"
"a" %|% "b" %&% "c"

"a" & "b" | "c"
"a" %&% "b" %|% "c"


[Package lazy.andor version 0.1.3 Index]