I have a data frame with a column of values (treatments assigned by randomisation) 1, 2, 3. Something like:

```

i,treatment
1,1
2,3
3,2
4,2
5,1
6,3
7,3
8,2
9,1
...

```

Each block of 3 rows within the data frame contains a permutation of the three available values, e.g. for rows 1-3 above `(1,3,2)`, for rows 4-6 `(2,1,3)`, for rows 7-9 `(3,2,1)`, etc. The number of rows in the data frame is divisible by 3.

I need to count the occurrences of the permutations - how can I do this?