[R] Coercion/conversion of logical index to integer index

holki659@student.otago.ac.nz holki659 at student.otago.ac.nz
Wed May 29 07:17:53 CEST 2002


Hi all,

This question has significant potential to be a stupid one, but as I could find no hints in 
the manual or previous posts:

If you have a logical index X:

>X
[1] TRUE FALSE TRUE TRUE FALSE

And you want an equivalent integer index Y:

>Y
[1] 1 3 4

Is there no easy way?  (I'm thinking of the equivalent of FIND in Matlab)


Kieran


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list