Skip to content
Prev 53073 / 63424 Next

can we override "if" in R?

Da Zheng would like to override 'if' and 'while' to accept more than
scalar logicals and Martin Maechler would like to change 'if' to
accept only scalar logicals.  No one has mentioned '||' and '&&',
which also want scalar logicals.

Perhaps a solution is to have all of these call a new generic
function, as.scalar.logical() on their relevant arguments.  (For
efficiency, the default would be internally dispatched).

Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Sun, Mar 5, 2017 at 4:43 PM, Gabriel Becker <gmbecker at ucdavis.edu> wrote: