I have a matrix of data and I wanted to remove all rows that have values below a set threshold of 10. I've checked other posts on here and they don't seem to work in my case in R for some reason. I still relatively new to R so getting to grips with it at the moment. What would you recommend I do to accomplish this?
For example, I would want the row "MIR6859-1" removed completely as it has count data below 10 across every condition.
Here is the code I have tried so far but I keep getting the error "Error in data < 10 : comparison (3) is possible only for atomic and list types"
or that the column name "KOA1" object not found with the subset method.
enter code here
fmcountdata1 <- mergecountdata1[!(mergecountdata1$KOA1<10),]
enter code here
fmcountdata1 <- enter code here
mergecountdata1[!apply(data<10,1,any,na.rm=TRUE),]
enter code here
fmcountdata1 <- mergecountdata1
enter code here
subset(fmcountdata1, KOA1<10)
Here is a snippet of the dataset:
KOA1 KOA2 KOA3 KOA4 KOB1 KOB2 KOB3 KOB4 CON1 CON2 CON3 CON4 DDX11L1 0 0 0 0 0 0 0 0 0 0 0 0 WASH7P 16 28 25 54 28 26 21 40 17 30 19 39 MIR6859-1 4 1 1 3 1 0 0 0 0 1 0 1 MIR1302-2HG 0 1 0 1 1 0 0 1 0 0 0 0 MIR1302-2 0 0 0 0 0 0
str of my data set: chr [1:59412, 1:12] " 0" " 16" " 4" " 0" ... - attr(, "dimnames")=List of 2 ..$ : chr [1:59412] "DDX11L1" "WASH7P" "MIR6859-1" "MIR1302-2HG" ... ..$ : chr [1:12] "KOA1" "KOA2" "KOA3" "KOA4" ... - attr(, "names")= chr [1:712944] NA NA NA NA ...