Learn R Programming

cwhmisc (version 6.0)

numberof: Count the number elements that satisfy a condition.

Description

numberof counts the number elements that satisfy a condition.

Usage

numberof(x, f)

Arguments

x
Numerical array.
f
Logical function emulating the condition to be satisfied.

Examples

Run this code
  numberof(c(1:100,NA,NA,NaN),function(x) !is.na(x))

Run the code above in your browser using DataLab