normalizeWeight: To normalize weight values.

Description Usage Arguments Details Value Author(s) Examples

View source: R/normalizeWeight.R

Description

To normalize weight values if normalize = TRUE.

Usage

1
normalizeWeight(normalize, weight, data)

Arguments

normalize

is a boolean value.

weight

is a numeric vector.

data

is a data.frame.

Details

This function allows users to normalize weights.

If there is not any weight, the function will create a numeric vector of "1".

If normalize = TRUE, the function will make every weight value as a "[0:1]" value.

If normalize = FALSE, the function will not make any changes, weights will be the same.

Value

Numeric vector with updated weights.

Author(s)

Roberto Alcántara roberto.alcantara@edu.uah.es

Juan José Cuadrado jjcg@uah.es

Universidad de Alcalá de Henares

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data <- data.frame(matrix(c(1:10),ncol = 2))

weight1 <- c(0.6,0.4)
weight2 <- c(2,4)

normalizeWeight(FALSE, weight1, data)

normalizeWeight(TRUE, weight2, data)

normalizeWeight(FALSE, weight2, data)

LearnClust documentation built on Nov. 30, 2020, 1:09 a.m.