Learn R Programming

LearnClust (version 1.1)

initTarget: To initialize target, hierarchical correlation algorithm.

Description

To initialize target, hierarchical correlation algorithm. It checks if target is valid, if not, it initializes the target

Usage

initTarget(target, data)

Arguments

target

is a numeric vector, a matrix or a data frame.

data

is a data frame with the main data.

Value

A cluster.

Details

This function is part of the hierarchical correlation method. The function initializes target and checks if it is a valid target.

The function transforms the target into a matrix. Then, it checks if the target has only one row and the same columns has the main data.

If it is not a valid target, the function will notice the problem and will initialized a new target with every column with value 0.

Examples

Run this code
# NOT RUN {
data <- matrix(c(1,2,1,4,5,1,8,2,9,6,3,5,8,5,4),ncol= 3)

dataFrame <- data.frame(data)

target1 <- matrix(c(2,3))

target2 <- matrix(c(2,3,6))

initTarget(target1,dataFrame)

initTarget(target2,dataFrame)

# }

Run the code above in your browser using DataLab