Delete rows where any column contains number
Finding rows containing a value (or values) in any column
Finding rows containing a value (or values) in any column
Extending on the question from the post above.
Suppose I have a dataset called m5:
set.seed(1234)
m3 <- matrix(12:1,nrow=6,ncol=4)
m4<-as.data.frame(m3)
m5 <- m4[sample(nrow(m4)),]
How do I select only rows where any column contains the value 12 or 9 or 7.
The end output should be rows 1, 2, and 6.
Also would be helpful if the proposed answer works for strings as well.