I have a dataframe:
Alix Blim Jux Gyno
0.105 0.234 0.67 0.89
0.01 0.542 0.11 0.65
0.003 0.002 0.6 0.67
0.009 0.123 0.09 0.01
df <- read.table(text='Alix Blim Jux Gyno
0.105 0.234 0.67 0.89
0.01 0.542 0.11 0.65
0.003 0.002 0.6 0.67
0.009 0.123 0.09 0.01
', header=T)
We can use sapply
to find the max value in each column, then check if it's greater than 0.6. This gives a logical vector which we can use to subset df
by column:
df[,sapply(df, max) > 0.6]
Jux Gyno
1 0.67 0.89
2 0.11 0.65
3 0.60 0.67
4 0.09 0.01