I've got 2 vectors:
c1 <- c(1,2,0,1,3,4,5,6,1,2,3,0)
c2 <- c(1,2,0,5,0,2,1)
> table(c1)
c1
0 1 2 3 4 5 6
2 3 2 2 1 1 1
> table(c2)
c2
0 1 2 5
2 2 2 1
Now I want c2
to have the following form:
> table(c2)
c2
0 1 2 3 4 5 6
2 2 2 0 0 1 0
How can I get out of these tables the vectors (2, 3, 2, 2, 1, 1, 1) and (2, 2, 2, 0, 0, 1, 0)?