Created
November 26, 2020 05:29
-
-
Save dingaroo/a9481caebb5cf9624d612787bcf3f497 to your computer and use it in GitHub Desktop.
Count Occurrence of certain words from a dataframe row in #R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(stringr) | |
getCount <- function(data,keyword) | |
{ | |
wcount <- str_count(dataset$text, keyword) | |
return(data.frame(data,wcount)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment