site is my data, and I would like to derive trip and seq.
library(data.table)
dt <- data.table(site=c("A", "A", "B", "B", "B", "A", "A", "C", "B"), 
                 trip=c(1,1,2,2,2,3,3,4,5), 
                 seq =c(1,2,1,2,3,1,2,1,1)) 
site is my data, and I would like to derive trip and seq.
library(data.table)
dt <- data.table(site=c("A", "A", "B", "B", "B", "A", "A", "C", "B"), 
                 trip=c(1,1,2,2,2,3,3,4,5), 
                 seq =c(1,2,1,2,3,1,2,1,1))