This seems like a very simple problem but I am unable to find a solution anywhere online. I want to subset a data frame to rows for which any column contains the string "string". This is how I want to subset the data:
subset <- df[which(df$V1 == 'string' | df$V2 == 'string' | df$V3=='string'),]
But my frame has many columns and it is very inefficient to list all of them. Is there a more efficient way to select rows for which ANY column contains 'string'?