ourMELONS/R/find.R
Waldir Leoncio 5fdff9fee2 '
2020-07-13 13:24:25 +02:00

10 lines
No EOL
249 B
R

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