ourMELONS/R/find.R
2020-03-18 10:30:37 +01:00

9 lines
No EOL
227 B
R

#' @title Find indices and values of nonzero elements
#' @description Emulates behavior of `find`
find <- function(x) {
if (is.logical(x)) {
return(which(x))
} else {
return(which(x > 0))
}
}