I have a data frame such as:
x <- data.frame("Names"= c("name1","name2","name3"), "A" = c(0.1,0.1,0.8), "B" = c(0.3,0.4,0.3), "C" = c(0.05,0.9,0.05),"D" =c(0.6,0.1,0.3))
> x
Names A B C D
1 name1 0.1 0.3 0.05 0.6
2 name2 0.1 0.4 0.90 0.1
3 name3 0.8 0.3 0.05 0.3
And what I would like is to remove all lines where the Max value of A , B , C or D is below 0.8. And then, get:
> x
Names A B C D
2 name2 0.1 0.4 0.90 0.1
3 name3 0.8 0.3 0.05 0.3
The name1 was removed because 0.6 was the max value.
And then I would like to get a file such as I get the NameX with the column name where the value is the max, in this exemple it would be:
Name1 : C with value 0.9
Name2 : A with value 0.8
Thank you for your help.