minmax: Minmax Normalization

Description Usage Arguments Details Value Author(s) Examples

Description

For each column of a matrix, it substracts its minimum and divide by the length of its range

Usage

1
minmax(mat)

Arguments

mat

A numeric matrix.

Details

An error is returned if there is at least one column whose values are all the same.

Value

The normalized matrix, with a vector with ' column minimums and a vector with the column range lengths as attributes.

Author(s)

Guillermo Basulto-Elias

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
mat <- matrix(c(0, 1, 2,
                3, 4, 5,
                3, 2, 1),
                nrow = 3, byrow = TRUE)
  drewcurves:::minmax(mat)
  
## Not run: 
mat <- matrix(c(0, pi, 1, 2,
                3, pi, 4, 5,
                3, pi, 2, 1),
                nrow = 3, byrow = TRUE)
drewcurves:::minmax(mat)
  
## End(Not run)

gbasulto/drewcurves documentation built on May 8, 2019, 6:47 p.m.