Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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.

Author(s)

Christian W. Hoffmann <christian@echoffmann.ch>

Examples

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

cwhmisc

Miscellaneous Functions for Math, Plotting, Printing, Statistics, Strings, and Tools

v6.6
GPL (>= 2)
Authors
Christian W. Hoffmann
Initial release
2018-08-24, 10:40:10

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.