You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#' Cumulative Kurtosis#' #' @family Vector Function#' #' @author Steven P. Sanderson II, MPH#' #' @details#' A function to return the cumulative kurtosis of a vector.#' #' @description #' A function to return the cumulative kurtosis of a vector.#' #' @parm .x A numeric vector#' #' @examples #' x <- mtcars$mpg#' #' ckurtosis(x)#' #' @return #' A numeric vector#' #' @export#' ckurtosis<-function(.x){
kurtosis<-function(.x){
length(.x) * sum((.x- mean(.x))^4) / (sum((.x- mean(.x))^2)^2)
}
sapply(seq_along(.x), function(k, z) kurtosis(z[1:k]), z=.x)
}
Function:
Example:
The text was updated successfully, but these errors were encountered: