Skip to content
Prev 199635 / 398506 Next

Find the first values in vector

On Nov 9, 2009, at 1:44 PM, Grzes wrote:

            
?rle

 > vec[ 1:rle(vec)$lengths[1] ]
[1] "TRUE" "TRUE" "TRUE" "TRUE"


Although that approach would faid if the first element were "FALSE".
David Winsemius, MD
Heritage Laboratories
West Hartford, CT