Entering edit mode
ALok
▴
170
@alok-2917
Last seen 10.3 years ago
Hi All
i have a object
gp = c(1,2,3,4,21,22,23,24,38,39)
and i want to count number of groups containing consecutive numbers
as
ans should be three as group1 (1,2,3,4), group2 (21,22,23,24) and
group3
contains (38,39)
any suggestions
[[alternative HTML version deleted]]