I would like to "bin" a large discrete variable by combining two consecutive rows into one bin. I would also like to call the bin by the first row value.
As an example:
x<-data.frame(x=c(1,2,3,4,5,6,7,8,9,10,11,12),
y=c(1,1,3,3,5,5,7,7,9,9,11,11))
x