#' z-normalize
#'
#' Apply z-normalization to the time series data
#'
#' @param timeseries Timeseries data that needs to be z-normalized
#' @export
#' @return z_normalized_timeseries A z-normalized timeseries
#'
z_normalize <- function(timeseries) {
ts_mean <- mean(timeseries)
ts_stdev <- stats::sd(timeseries)
z_normalized_timeseries <- (timeseries - ts_mean)/ts_stdev
return(z_normalized_timeseries)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.