I am looking for a method to loop through a data frame in R, removing the max value above a specific condition, creating a new data frame excluding that row, re-calculating the