If I define a list like this:
a <- list(1,2,3,4,5,1)
and then call table(a) , I get:
, , a.3 = 3, a.4 = 4, a.5 = 5, a.6 = 1
a.2
a.1 2
1 1
Isn't this behavior weird? How could I use the table function on this list to get something like:
1 2 3 4 5
2 1 1 1 1
table(unlist(a))? Is there a reason it needs to remain alist?