I would like to tabulate by row within a data frame. I can obtain adequate results using table within apply in the following example:
table
apply
Protect the result by wrapping with list:
list
apply(tdf.2[4:nrow(tdf.2),1:nrow(df.2)], 2, function(x) {list(table(x, useNA = "ifany")) })