[R] problems subsetting
martin.tomko at geo.uzh.ch
Thu Nov 18 16:42:09 CET 2010
Thanks Steve, that explains it... Unfortunately, I did nto get that from
my R docs...
I am still searching for a solution for matching the entries in my
matrix by matching the rownames to the entires in a subset I got using
On 11/18/2010 4:35 PM, Steve Lianoglou wrote:
> On Thu, Nov 18, 2010 at 10:25 AM, Martin Tomko<martin.tomko at geo.uzh.ch> wrote:
>> Hi Gerrit,
>> indeed, that works. Excellent tip!
>> For reference, I did this:
>> I am still not totally sure when one uses "&" amd when"&&" - I was under
>> the impression that&& stands for logical AND....
> If you can't find the appropriate documentation, try to experiment in
> your workspace:
> R> c(TRUE, TRUE, FALSE, TRUE)& c(FALSE, TRUE, TRUE, TRUE)
>  FALSE TRUE FALSE TRUE
> R> c(TRUE, TRUE, FALSE, TRUE)&& c(FALSE, TRUE, TRUE, TRUE)
>  FALSE
> The single logical operators (& , |) run over the entire length of
> your logical vectors.
> The doubles (&&, ||) just evaluate the first element of the vectors,
> and ignore the rest.
More information about the R-help