R/Normalize.R

Defines functions Norm Normalize

Documented in Norm Normalize

#' Normalize and Norm
#'
#' Norm returns the euclidian norm of a vector, Normalize returns a vector with unit norm.
#' @aliases Norm
#' @param  x Numeric vector
#' @return Normalized vector or inpout vector norm.
#' @author Diogo Melo, Guilherme Garcia
#' @export
#' @rdname Normalize
#' @examples
#' x <- rnorm(10)
#' n.x <- Normalize(x)
#' Norm(x)
#' Norm(n.x)
Normalize <- function(x){return(x/Norm(x))}
#' @export
#' @rdname Normalize
Norm <- function(x){return(sqrt(sum(x*x)))}

Try the evolqg package in your browser

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

evolqg documentation built on Aug. 8, 2023, 5:12 p.m.