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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -