I want to create a piechart from the number of occurrences in the dataframe column. However, there are 5 words that I want to delete before I make a piechart. I have a dataframe and I can remove these lines using something like:
subset(df, tag != "rubbish")
However, if I then draw using
pie(table(df$tag)
Trash still appears in piechart, but with Zero instances.
table(df$tag) before the subset gives me something like:
tag1 3 tag2 7 rubbish 9
and after:
tag1 3 tag2 7 rubbish 0
Do I need to delete garbage at all without a table () returning zero? I tried table(df$tag, exclude="rubbish") , but there is more than one tag that I want to remove.
source share