Let's say I have the following dataset, and want to fill in the column "freq" based on the frequency of the word in the column "word".
#df
word freq
a
um
yeah
I'm
no
a
The outcome will look like this:
word freq
a 2
um 1
yeah 1
I'm 1
no 1
a 2
How should I code on R ?