I am trying to count how many times a keyword appears in a string. In the following variable text, I would like to count how many times keyword appears in text. The result should display 3 because AWAY appears twice and WIN appears once in the string.
text<- "AWAYTEAM IS XXX. I THINK THEAWAYTEAM WILL WIN"
keyword<- c("AWAY","WIN")
Any ideas?