#' get 2 valleys of a smooth curve
#'
#' @param curve
#'
#' @return
#' @export
#'
#' @examples
get.2valleys <- function(curve) {
# VER 3.4.1
#
if(is.null(valley <- get.valley(curve))) return(NULL)
if(is.null(peak <- get.peak(curve))) return(NULL)
if(peak < valley) {
if(!is.null(y <- get.valley(curve[1:peak])))
valley[2] <- y
else return()
} else {
if(!is.null(u <- get.valley(curve[peak:length(curve)])))
valley[2] <- u
else return()
}
return(valley)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.