My problem is this:
A table containing different values and what I need is to eliminate the singletons (rowSums = 1) and dobletons (rowSums = 2) at the same time without need to repeat the steps.
Name samp1 samp2 samp3 samp4
A 1.00 4.92 3.34 56.90
B 1.97 3.96 8.65 2.79
C 1.00 0.00 0.00 0.00
D 1.70 4.32 3.97 3.37
E 0.00 0.00 2.00 0.00
I first tried this to eliminate singletons
data = read.table(file="XXX", header = TRUE, row.names=1)
data_no_singletons = data[rowSums(data)!=1,]
data_no_dobletons = data_no_singletons[rowSums(data_no_singletons)!=2,]
Is it possible to eliminate the rows using both conditions at the same time to get this table?
Name samp1 samp2 samp3 samp4
A 1.00 4.92 3.34 56.90
B 1.97 3.96 8.65 2.79
D 1.70 4.32 3.97 3.37
SOLVED Include ">2" and that`s all
data_cleaned = data[rowSums(data)> 2,]