ncat: Number of categories

View source: R/RcppExports.R

ncatR Documentation

Number of categories

Description

This function returns the number of factor in each column of a categorical matrix.

Usage

ncat(Xcat_input)

Arguments

Xcat_input

A matrix of integers that contains categorical vector in each column.

Value

A row vector that contains the number of categories in each column.

Examples

Xcat <-  matrix(c(sample(x = 1:6, size = 100, replace = TRUE),
            sample(x = 1:6, size = 100, replace = TRUE),
            sample(x = 1:6, size = 100, replace = TRUE)),ncol = 3)
ncat(Xcat)

StratifiedSampling documentation built on April 4, 2025, 5:11 a.m.