I have a dataframe:
ID value value_type
A 256 new
B 543 new
A 544 old
I want to apply janitor::tabyl to columns ID and value_type to get:
ID
n percent
A 2 0.66
B 1 0.33
value_type
n percent
new 2 0.66
old 1 0.33
How could I do that? When I do:
janitor::tabyl(dt[, c(ID, value_type)])
it doesn't separate those statistic tables by column