Learn R Programming

discoveR (version 2.2.6)

e_mapa: PCA plot of individuals colored by clusters

Description

PCA plot of individuals colored by clusters

Usage

e_mapa(pca.model, clusters, colores = NULL, ejes = c(1, 2))

Value

echarts4r plot

Arguments

pca.model

an object of class PCA [FactoMineR].

clusters

a vector specifying the cluster of each individual.

colores

a vector of color for each cluster.

ejes

a numeric vector of length 2 specifying the dimensions to be plotted.

Author

Diego Jimenez <diego.jimenez@promidat.com>

Examples

Run this code
p <- discoveR:::PCA(iris[, -5], graph = FALSE)
clusters <- factor(kmeans(iris[, -5], 3)$cluster)
e_mapa(p, clusters, c("steelblue", "pink", "forestgreen"))

Run the code above in your browser using DataLab