R/normalize.R

Defines functions normal_zero normal_distribution

Documented in normal_distribution

#' Functions 
#'
#' @param vec a \code{vector} 
#'
#' @return a \code{vector}
#' @importFrom stats sd
#' @export
#'

normal_distribution <- function(vec) {
  vec <- as.numeric(vec)
  vec[is.na(vec)] <- mean(vec[!is.na(vec)])
  norm <- (vec - mean(vec))/sd(vec)

  return(norm)
}

normal_zero <- function(vec) {
  vec <- as.numeric(vec)
  norm <- (vec - vec[1])

  return(norm)
}

Try the sistmr package in your browser

Any scripts or data that you put into this service are public.

sistmr documentation built on March 24, 2022, 9:05 a.m.