count: A more versatile form of the T-SQL 'count()' function.

View source: R/row.r

countR Documentation

A more versatile form of the T-SQL count() function.

Description

Implementation of T-SQL count and Excel COUNTIF functions. Shows the total number of elements in any number of data objects altogether or that match a condition.

Usage

count(..., condition = (function(x) TRUE))

Arguments

...

an arbitrary number of R objects

condition

a 1 argument condition

Details

Originally written for the row.r package by Craig Varrichio. Included here because the rowr package was discontinued. I use these functions in my packages

Examples

count(c(NA,1,2))
count(c(NA,1,2),is.na)
count(c(NA,1,2),list('A',4),cbind(1,2,3))
count(c(NA,1,2),list('A',4),cbind(1,2,3),condition=is.character)

ccpluncw/ccpl_R_chutils documentation built on Feb. 28, 2024, 1:17 a.m.