Skip to content
Prev 177988 / 398502 Next

Count Code

David Winsemius wrote:
I think this one could be

count <- ave(a1$subject_id, a1$subject_id, FUN = seq_along)

(assuming that "count+1;" increases the value from the previous record.)