[R] Detect numerical series

syrvn mentor_ at gmx.net
Sat Feb 11 16:01:38 CET 2012


Hello,

I am struggling with detecting successive digits in a numerical series
vector.

Here is an example:

vec <- c(1, 15, 26, 29, 30, 31, 37, 40, 41)

I want to be able to detect 29, 30, 31 and 40, 41.

Then, I would like to delete the successive digits from the vector.

1, 15, 26, 29, 37, 40


Cheers

--
View this message in context: http://r.789695.n4.nabble.com/Detect-numerical-series-tp4379088p4379088.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list