Writing an Ifelese Command to Detect Whether a Word Appears in a Dataframe in R
I am looking to receive help on creating a binary variable in RStudio based on whether a specific dictionary of terms appears within text data. I currently have a data frame, where one of those columns (text) contains different texts. I would like to create a new variable within that data frame which detects whether the words in my dictionary appear in any given text (to be coded as 1), or if the words in my dictionary do not appear in any given text(coded as 0).