Nothing
#' Find the index of the first nonzero value in a vector
#'
#' @param vec A binary vector
#' @return Position of the first nonzero value in a vector.
position_finder <- function(vec) {
if(length(which(vec == 1)) != 0) {
return(min(which(vec == 1)))
} else {
return(999999)
}
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.