#' Title
#'
#' @param curve
#'
#' @return
#' @export
#'
#' @examples
get.first.peak <- function(curve){
# ver 3.4.1
# get peak --> peak1
if(!is.null(peak1 <- get.peak(curve))) {
# get valley to the left --> valley1
if(!is.null(valley <- get.valley(curve[ 1:peak1 ]))) {
# -> has valley get peak to the left
if(!is.null(peak2 <- get.peak(curve[ 1:valley ]))) {
# -> has peak get first peak [1, valley.x]
return(get.first.peak(curve[ 1:valley ]))
} else {
# -> no peak return peak1
return(peak1)
}
} else {
# -> no valley return peak1
return(peak1)
}
} else {
return(NULL)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.