I just had some problems with computing a boolean vector as a result of applying AND to two boolean vectors:

As you can see, it’s a nice result, but not what I want.. My hack was the following:

When Rumpel, my personal R-freak, saw that hack, he just laughed and told me the short version of this hack:

Nice, isn’t it ;)

Michael Rennecke | Permalink | 2010-10-13 14:54:36

The Rumpel solution is like the syntax in other languages. && is the bitwise operator und & ist the logical operator. The behavior with vectors is specific for the languages. I think matlab has a similar syntax. You need more languages in your head. I need a bag with english knowledge :P

Nerd | Permalink | 2010-10-14 09:26:08

Michael is perfectly right, it’s just the other way round (&& is the logical “and”, & the bitwise).

Martin Scharm | Permalink | 2010-10-14 09:48:13

Thanks to both of you, sometimes I miss the wood for the trees (-;