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)
}

Try the RRMLRfMC package in your browser

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

RRMLRfMC documentation built on June 7, 2021, 9:08 a.m.