powered by
It acts similiarly to Excel's MAXIF function. It returns the maximum value from an array after testing for certain criterias.
MAXIF(range, criteria, max_range)
Range where it should check the criteria
Where should it lookup the value
Which array should it return the max from.
In this case we get the maximum value of Sepal Length from Species which are virginica. Function will always return numeric class.
# NOT RUN { MAXIF(iris$Species,"virginica",iris$Sepal.Length) # }
Run the code above in your browser using DataLab