Skip to content
Prev 342940 / 398506 Next

ask for help

I prefer the idiom
  c(TRUE, a[-1] != a[-length(x)])
because it works for character and other data types as well.

I also find that thinking in terms of runs instead of subscripting
tricks is easier.