firstZeroIndex: First zero index for each column of a matrix

View source: R/RcppExports.R

firstZeroIndexR Documentation

First zero index for each column of a matrix

Description

For each column, returns the 1-based index of the first zero value. If a column contains no zeros, returns NA for that column.

Usage

firstZeroIndex(mat)

Arguments

mat

NumericMatrix

Value

IntegerVector of length ncol(mat) with 1-based indices or NA.

Examples

m <- matrix(c(1, 0, 2,0, 3, 1),nrow = 3, ncol = 2)
firstZeroIndex(m)

bunsen documentation built on Sept. 3, 2026, 5:09 p.m.