Say I have a data frame with three columns:
tt <- data.frame(a = c(1,2,2,2,3,3,3,3), b = c(1,1,0,0,1,0,0,0), c = c(100,200,5,5,300,5,5,5))