I am trying to create a variable that identifies each unique subject and "clusters" their visits together. For example:
ID Visit Cluster
S101 0 1
S101 6 1
S101 12 1
S102 0 2
S105 0 3
S105 6 3
How can I create this new variable "Cluster"? I mostly use the dplyr package.