Say I have Hits-object along these lines:
from <- c(5, 2, 3, 3, 3, 2) to <- c(11, 15, 5, 4, 6, 11)
hits <- Hits(from, to, 7, 15, sort.by.query=TRUE)
For every hit, I can assign some value:
mcols(hits)$val <- c(10, 11, 15, 12, 10, 10)
I then want to break all ties, similar to breakTies:
However, I don't just want to resolve ties by the index, but rather on the val-column in mcols, i.e. the maximum value so the output would look like this:
Is there a smart way on doing this, without first coercing the Hits-object into a data.frame and then back?