I have the BigQuery Dataset with Reddit Comments. It has multiple columns, one which is the body column with the actual comment. I now want to search for a certain word, like a brand mention, for instance "BMW" in the body column and create a subset of the rows which contain "BMW" in data$body.
The dataset looks similar to this:
str(data)
data.frame: 75519 obs. of 113 variables
$ body: chr "...." .....
$ name: Factor w/ 22805 levels ....
....
I know the SQL command, which looks like this
SELECT * FROM dataset
WHERE body contains "BMW"
Is there a similar command in R?
Thank you very much!
EDIT: Solutions is
bmw <- data[grep("BMW", data$body),]
Thanks to charleslmh