R/normv.R

Defines functions normv

Documented in normv

#' @title Normalize function for a vector
#' @description 
#' To calculate normalize of a vector
#' @param x a numeric vector
#' @return a vector with norm 1
#' @export
#' @keywords internal
normv <- function(x){
  
  normx = sqrt(sum(x * x))
  y    = x / normx 
  return(y)
}

Try the multigroup package in your browser

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

multigroup documentation built on March 26, 2020, 5:50 p.m.