« first day (388 days earlier)   

1:55 AM
0
Q: How to combine multiple rows in dplyr randomly

PeterI have a data set that looks like this: Id Type Tag 1 a blue 1 a green 1 b yellow 1 b red 2 a black 2 a grey 2 b purple 2 b cyan 3 a orange 3 a yellow 3 b red 3 b blue ... I would like to sample 2 rows per distinct Id value, combining those rows ...

 

« first day (388 days earlier)