numberOfCases: A generic function computing the number of cases.

View source: R/helpers.R

numberOfCasesR Documentation

A generic function computing the number of cases.

Description

Different representations of datasets provide its elements in a very different way. This function provides a uniform interface to figure get the number of cases in a dataset.

Usage

numberOfCases(x)

## S3 method for class 'data.frame'
numberOfCases(x)

## Default S3 method:
numberOfCases(x)

Arguments

x

a dataset, of which the number of cases shall be counted. It can be a numeric vector, a matrix, a data.frame, a compositional dataset, or a BData object.

Value

an integer

Methods (by class)

  • numberOfCases(data.frame): method for dataframes

  • numberOfCases(default): method for lists and numeric, BDataDensities,...

Examples

data(iris)
numberOfCases(iris$Sepal.Length)
numberOfCases(iris)
numberOfCases(lapply(1:numberOfCases(iris),function(i) iris[i,]))


DistributionalDDA documentation built on Oct. 20, 2026, 5:06 p.m.