Is there a way to extract continuous feature in an 2D array

Posted by Derek on Stack Overflow See other posts from Stack Overflow or by Derek
Published on 2010-03-18T13:56:26Z Indexed on 2010/03/18 15:01 UTC
Read the original article Hit count: 533

Filed under:
|
|
|

Say I have an array of number

a <- c(1,2,3,6,7,8,9,10,20)

if there a way to tell R to output just the range of the continuous sequence from "a" e.g., the continuous sequences in "a" are the following

1,3 6,10 20

Thanks a lot! Derek

© Stack Overflow or respective owner

Related posts about r

    Related posts about continue