count
unknown
r
4 years ago
393 B
8
Indexable
numbering3 <- function(mats, indices) {
if(nrow(mats) ==0) return(vec)
ones <- which(mats[, 1] == 1)
zeros <- which(mats[, 1] == 0)
if(ncol(mats) > 1) {
numbering3(mats[ones, -1, drop=FALSE], indices[ones])
numbering3(mats[zeros, -1, drop=FALSE], indices[zeros])
}
else {
if(length(ones)>0) print(indices[ones])
if(length(zeros)>0) print(indices[zeros])
}
}Editor is loading...