I am trying to count the number of times each variable occurs across two separate columns. Similar to:
var1 var2 var3
a b a
c c a
b a b
I want to know the number of times each variable occurs in the columns var1 and var2. The output should look something like
var count
a 3
b 2
c 1
I have seen similar questions on stackoverflow but haven't seemed to find one that is what I am looking for.