R/COUNT.R

Defines functions COUNT

Documented in COUNT

# COUNT Function from Excel
#' Basic COUNT function from excel
#'
#' It acts similiarly to Excel's COUNT function. It counts the amount of values in the given array.
#'
#' @param value Count amount of the values in the range.
#' @import base
#' @import plyr
#' @export
#' @examples
#' COUNT(iris$Species)
#' @return In this example we count the amount of species in the built-in iris dataset. Function will always return numeric class.

COUNT <-
function(value){

  sum(count(value)[,2]) - sum(is.na(value))

}

Try the ExcelFunctionsR package in your browser

Any scripts or data that you put into this service are public.

ExcelFunctionsR documentation built on July 1, 2020, 8:35 p.m.