You are on page 1of 1

r = getOption("repos")

r["CRAN"] = "http://cran.us.r-project.org"
options(repos = r)
# Install factoextra
install.packages("factoextra")

# Install cluster package


install.packages("cluster")

library(factoextra)
library(NbClust)
library("ggplot2")

dataset <- na.omit(dataset)

df <- scale(dataset)

fviz_nbclust(df,kmeans,method = "wss")+
geom_vline(xintercept = 4, linetype =2)+
labs(subtitle ="Elbow method")

You might also like