I have a dataframe such as :
ANIMALS query
3 A
4 [CAT], [DOG] B
5 C
6 [CAT] D
7 E
8 [CAT], [SHARK], [DOG] F
and I would like to get a summary of proportion of numbers list elements between in ANIMALS
Summary expected :
ANIMALS Freq
CAT 0.50
DOG 0.33
SHARK 0.17
Here is tha dataframe in dput format if it can helps:
structure(list(ANIMALS = list(character(0),
c("[CAT]", "[DOG]"), character(0), "[CAT]",
character(0), c("[CAT]", "[SHARK]", "[DOG]"
)), query = c("A",
"B", "C",
"D", "E",
"F")), row.names = 3:8, class = "data.frame")
So far I tried to use the traditional table(tab$ANIMALS) but it does not work.