powered by
It acts similiarly to Excel's COUNTIF function. It counts the amount of cells that comply with the given criteria.
COUNTIF(range, criteria)
Specify range for Countif
Give the criteria to check the range for.
In this example we count the amount of setosa in iris dataset. Function will always return numeric class.
# NOT RUN { COUNTIF(iris$Species,"setosa") # }
Run the code above in your browser using DataLab