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 <- c(1,2,3)
target2 <- dataFrame[1,]
weight1 <- c(1,6,3)
weight2 <- c(0.1,0.6,0.3)
# Basic usage
correlation_clustering(dataFrame, target1)
# With weights
correlation_clustering(dataFrame, target1, weight1)
# Without weight normalization
correlation_clustering(dataFrame, target1, weight1, normalize = FALSE)
# Using Canberra distance with weights
correlation_clustering(dataFrame, target1, weight2, distance = "canberra", normalize = FALSE)
# With detailed explanations
correlation_clustering(dataFrame, target1, learn = TRUE)
Run the code above in your browser using DataLab