R/norm_var.R

Defines functions norm_var

Documented in norm_var

#' norm_var
#' @description Standardize a numeric variable
#' @param x A numeric variable
#'
#' @return The standardized variable
norm_var <- function(x){
        result <- (x-mean(x))/sd(x)
        result <- ifelse(is.na(result), 0, result)
        return(result)
}

Try the PheVis package in your browser

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

PheVis documentation built on Oct. 20, 2023, 9:08 a.m.