I have a dataframe in the following form:
Date equity company press Categorization Year Month Event greenwashing
<chr> <dbl> <chr> <chr> <chr> <dbl> <chr> <dbl> <chr>
1 07/30/21 153. JPMorgan NA NA NA NA NA 0
2 07/29/21 153 JPMorgan NA NA NA NA NA 0
3 07/28/21 152. JPMorgan NA NA NA NA NA 0
4 07/27/21 151. JPMorgan NA NA NA NA NA 0
5 07/26/21 152. JPMorgan NA NA NA NA NA 0
6 07/23/21 151. JPMorgan NA NA NA NA NA 0
In the column 'greenwashing' there are some variables that are in the format character such as: The Guardian, Financial Times, among others. I need to turn these characters into 1.
I already tried to name a word list and use the if else code:
word.list = c("Financial Times",
"The Guardian",
"Mena Report",
"States News Service",
"US Newshire",
"DeSmogBlog",
"PR Newshire",
"The New York Times")
if(word.list){
print("1")