[R] Loc function in R??

Rolf Turner r.turner at auckland.ac.nz
Tue Nov 20 21:12:58 CET 2007


?which

On 21/11/2007, at 9:06 AM, Barb, Jennifer (NIH/CIT) [E] wrote:

> Does anyone know which function (if any) will return the index of the
> true locations in a Boolean vector?
>
>
>
> For instance:
>
> A=c(1,3,5,7,4);
>
> B=c(2,4,77,3,3);
>
> X=A<B;
>
>
>
> So X is:
>
>> X
>
> [1]  TRUE  TRUE  TRUE FALSE FALSE
>
>
>
> I'd like to know if there is a function that will tell me the  
> locations
> of where the TRUE values are?  for instance a vector that will list  
> that
> the locations are at 1, 2, 3.  This function is sometimes called loc()
> in other languages.


######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}



More information about the R-help mailing list