I have a df such as below...
V1 V2 V3 V4 V5 V6 V7 V8
m.Bra004793 Bra004793 887 887.00 21.74 0.45 0.29 16.40
m.Bra004793.1 Bra004793 907 907.00 20.52 0.42 0.27 15.11
m.Bra004793.2 Bra004793 1006 1006.00 16.39 0.30 0.19 10.81
m.Bra004793.3 Bra004793 988 988.00 56.56 1.05 0.67 38.02
m.Bra004793.4 Bra004793 1097 1097.00 32.69 0.54 0.35 19.67
For each of the unique id (such as Bra004793) i want to select the best V1 by selecting the maximum V8. For example in this case i wanted to get the following id
m.Bra004793.3 Bra004793 988 988.00 56.56 1.05 0.67 38.02
but unfortunately the dplyr package that i am trying is not working. This is what i tried so far..
test <- read.table("test_PASA_isoform.csv", sep = ",", h = T)
head(test)
data.filetered <- as.data.frame(test %.% group_by(V2) %.% summarise(V8 = max(V8)))
head(data.filetered)
V2 V1 V8
1 Bra004793 m.Bra004793 38.02
Here you can see even though i am getting the correct result, i am not getting the correct V1 id. Can anybody point to me where i am doing wrong.
Thanks Upendra