StandDist: Standardizing a matrix to be between 0 and 1.

Description Usage Arguments Value Examples

View source: R/distance_functions.R

Description

Takes in a matrix and subtract the minimum element and divides by the range to return a matrix with elements between 0 and 1.

Usage

1

Arguments

x

Matrix to be standardized. There should be at least two different entries in x.

Value

A matrix of the same dimensions as the one given.

Examples

1
2
3
4
5
set.seed(1)
D <- matrix(rexp(800, rate = 0.5), 20, 40)
Dnew <- StandDist(D)
hist(D)
hist(Dnew)

gpapadog/DAPSm documentation built on May 17, 2019, 8 a.m.