Skip to content
Prev 316098 / 398502 Next

ifelse to speed up loop?

rle() or c(TRUE, cumsum( v[-length(v)] != v[-1] )) will work on any
type for which != is defined.  The ones involving diff() require numeric inputs.

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com