I want to search my dataset for those values that some attributes from multiple columns.
For that, I found that I can use grep like so:
df <- read.csv('example.csv', header = TRUE, sep='\t')
df[grep("region+druggable", df$locus_type=="region", df$drug_binary==1),]
But when I run this, my output is the different column names. Why is this happening?
my dataframe is like this:
id locus_type drug_binary
1 pseudogene 1
2 unknown 0
3 region 1
4 region 0
5 phenotype_only 1
6 region 1
...
So ideally, I would expect to get the 3rd and 6th row as a result of my query.