I'd like to make a frequency count individually for multiple columns with same possible values. The idea is to keep all columns from original data table, just adding a new one for levels and aggregating.
Here is an example of input data:

```
foo <- data.table(a = c(1,3,2,3,3), b = c(2,3,3,1,1), c = c(3,1,2,3,2))
#   a b c
#1: 1 2 3
#2: 3 3 1
#3: 2 3 2
#4: 3 1 3
#5: 3 1 2

```

And desired output:

```
data.table(levels = 1:3, a = c(1,1,3), b = c(2,1,2), c = c(1,2,2))
#   levels a b c
#1:      1 1 2 1
#2:      2 1 1 2
#3:      3 3 2 2

```

Thanks for helping !