ourMELONS/R/find.R

9 lines
227 B
R
Raw Normal View History

2020-03-18 10:30:37 +01:00
#' @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))
}
}