normalise: Normalise points

Description Usage Arguments Value Author(s) Examples

View source: R/normalise.R

Description

Normalise points per coordinate to a range, e.g., c(1,2), where the minimum value will correspond to 1 and the maximum to 2. If bounds are given, they are used for the normalisation.

Usage

1
normalise(data, to.range = c(1, 2), lower = NA, upper = NA, maximise = FALSE)

Arguments

data

(matrix | data.frame)
Matrix or data frame of numerical values, where each row gives the coordinates of a point.

to.range

Normalise values to this range. If the objective is maximised, it is normalised to c(to.range[1], to.range[0]) instead.

lower, upper

Bounds on the values. If NA, the maximum and minimum values of each coordinate are used.

maximise

(logical() | logical(1))
Whether the objectives must be maximised instead of minimised. Either a single logical value that applies to all objectives or a vector of logical values, with one value per objective.

Value

A numerical matrix

Author(s)

Manuel López-Ibáñez

Examples

1
2
3
4
5
6
7
data(SPEA2minstoptimeRichmond)
# The second objective must be maximized
head(SPEA2minstoptimeRichmond[, 1:2])

head(normalise(SPEA2minstoptimeRichmond[, 1:2], maximise = c(FALSE, TRUE)))

head(normalise(SPEA2minstoptimeRichmond[, 1:2], to.range = c(0,1), maximise = c(FALSE, TRUE)))

eaf documentation built on May 7, 2021, 5:06 p.m.