unitize: Convert a Vector to Unit Length

Usage Arguments Examples

View source: R/04-reaper.R

Usage

1
unitize(mat)

Arguments

mat

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (mat) 
{
    enorm <- sqrt(apply(mat^2, 2, sum))
    sweep(mat, 2, enorm, "/")
  }

Thresher documentation built on May 21, 2017, 12:33 a.m.

Search within the Thresher package
Search all R packages, documentation and source code