Hi,

I'm working on a data that each sentence is in separate rows in dataframe. I want to determine word frequency in each row with a word list that I have created. Then I would like to add these values to my dataframe as a new variable in R.

For example:

Let's say, I have a list of words that contains apple and banana. And I have three independent sentences in rows:

1. X x x apple x x banana x apple.

2. X apple x x x x.

3. X x babana x apple x.

Now I want to calculate how many times the words in my list have been repeated. As a result, the new column I want to create is:

1. = 3

2. = 1

3. = 2

Thanks in advance.

More Fatih Bayrak's questions See All
Similar questions and discussions