Learn R Programming

FactoClass (version 1.0.9)

centroids: Centroids of the Classes of a Partition

Description

It evaluates the centroids of a partition with the weights in rw

Usage

centroids(df,cl,rw=rep(1/nrow(df),nrow(df)))

Arguments

df
object of class data.frame, with the data of variables or coordinates
cl
vector indicating the cluster of each element
rw
weight of the rows of df, by default the same

Value

  • Object of class list with the following:
  • centroidsclass centroids
  • weightsclass weights

Examples

Run this code
data(iris)
centroids(iris[,-5],iris[,5])

Run the code above in your browser using DataLab