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

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -