I have two tables of Twitter API data bound together and I want a function that determines if the text contains the word f150. If it does then it should return ford, if not it should search the text for the word Silverado and if Silverado is found it should return chevy. all others should be null.
I saw this online but it isn't working for me. Also are there wildcards in R like in SQL?
`tweet_sentiments <-
tweet_sentiments %>%
mutate(vehicle = if(text = "f150") {ford}
else_if(text= "silverado"){Chevy})
Aucun commentaire:
Enregistrer un commentaire