boolean expression - Why do logical operators negate their argument when there is only one argument in R? -


when passing single vector logical and/or operator, operator negates argument:

> x = c(f,t,t) > `&`(x) [1]  true false false  > `|`(x) [1]  true false false 

to make logical operator work idempotent, 1 needs pass single element vector second argument:

> `&`(x,t) [1] false  true  true  > `|`(x,f) [1] false  true  true 

why logical operators negate argument when there 1 argument passed?

this was modified in r 3.2.1 result of a bug report. you've pointed out, previous behavior made little sense:

enter image description here


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -