I'm trying to optimize an algorithm in R that runs over an ordered set of values and determines whether there are values 'in the future' ( further down the set ) that have a lower value than the given value.I'm trying to optimize an algorithm in R that r