I thought this would be easy but I'm hitting a wall. Very simply, I'd like to return the value in V2 based on the max value in V1. If there's a tie in the V1 max values it would "randomly" pick one and return the V2 value.
Any assistance would be greatly appreciated!
set.seed(1)
DF <- matrix(sample(1:40,40),ncol=2,nrow=20)
DF <- as.data.frame.matrix(DF)
View(DF)