[问题] 去除重复值

楼主: tHEiPHoNe ( )   2016-03-18 01:48:20
请问有一组资料
纪录user点击item纪录
同一个user想踢除相邻的重复值
如下
id click
1 a
1 a ->重复
1 b
1 a
1 c
1 c ->重复
1 a
1 a ->重复
1 b
1 b ->重复
1 b ->重复
1 a
2 a
2 a ->重复
2 b
2 c
2 a
2 b
2 c
请问该如何处理呢?
谢谢
作者: celestialgod (天)   2016-03-18 01:55:00
dplyr::distinct没看到邻近XDD,用rle找出来第一笔吧

Links booklink

Contact Us: admin [ a t ] ucptt.com