powered by
It acts similiarly to Excel's SUMIF function. It sums the values where certain criterias are met.
SUMIF(range, criteria, sum_range)
Which range should it check the criteria against.
what criteria should it check in range
Which range should it sum
In this case we are summing Sepal length of species which are virginica. Function will always return numeric class.
# NOT RUN { SUMIF(iris$Species,"virginica",iris$Sepal.Length) # }
Run the code above in your browser using DataLab