powered by
For each column, returns the 1-based index of the first zero value. If a column contains no zeros, returns NA for that column.
firstZeroIndex(mat)
IntegerVector of length ncol(mat) with 1-based indices or NA.
NumericMatrix
m <- matrix(c(1, 0, 2,0, 3, 1),nrow = 3, ncol = 2) firstZeroIndex(m)
Run the code above in your browser using DataLab