The goal is to produce a frequency table of all my selected variables (about reading habits for 4 Newspapers) which in essence have the same possible values:
1=
This is similar to @Anandas solution (I will post it because was already in middle of writing)
df <- data.frame(a, b, d, e) do.call(cbind, lapply(df, function(x) table(factor(x, levels = 0:4)))) # a b d e # 0 0 2 5 0 # 1 2 1 0 0 # 2 2 2 2 0 # 3 4 3 2 10 # 4 2 2 1 0