#' Fit curve with spline
#'
#' @param y
#' @param x
#' @param r the x to predict from
#' @param para
#'
#' @return
#' @export
#'
#' @examples
fit.smooth <-
function(y, x = seq_along(y), r = x, para = NULL) {
# VER 3.3.1
smooth.y <- NULL
try({
smooth.y <- smooth.spline(x, y)$y
}, silent = T)
if (is.null(smooth.y)) {
cat(sprintf('Fit.smooth Failed'))
return(NULL)
}
# if (!area.output)
return(smooth.y)
# area <- finiteIntegrate(x = x, y = smooth.y, r = x)
# return(area)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.