tidy_kmeans: Tidy Output for KMeans Clustering

Description Usage Arguments Value Examples

View source: R/sptidy.R

Description

Creates a tidy dataframe containing information at the cluster level for a kmeans clustering algorithm

Usage

1
tidy_kmeans(Model, X)

Arguments

Model

A kmeans object created by stats::kmeans().

X

data.frame of the original data set.

Value

tibble of infomration associated with each cluster

Examples

1
2
3
4
5
6
7
library(dplyr)
library(sptidy)

data(iris)
data <- iris %>% select(-Species)
kclust <- kmeans(data, centers = 3)
tidy_kmeans(kclust, data)

UBC-MDS/sptidy documentation built on March 23, 2021, 8:33 a.m.