R/norm.R

Defines functions norm

Documented in norm

#' norm
#'
#' This function is used to normalize a vector to have unit length
#'
#' @param x a numeric vector
#'
#' @return a normalized vector with length 1
#'
#'
#'
#'
#'
#'

norm = function(x){
  y=x/sqrt(sum(x^2))
  return(y)
}
wangpeinihao/RRMLRfMC documentation built on June 19, 2021, 12:25 a.m.