kmeans_df: kmeans function that takes a data.frame and a formula as...

Description Usage Arguments Value Examples

View source: R/kmeans_df.R

Description

This function is a simple wrapper that lets you work with kmeans() while using data.frame, thus allowing you to stay with the same format.

Usage

1

Arguments

data

A data.frame.

formula

an object of class "formula" (or one that can be coerced to that class)

...

Additional arguments to be passed to the kmeans function.

Value

an object of class "kmeans".

Examples

1
2
3
kmeans_df(cars, ~ ., centers = 2)

kmeans_df(iris, ~ Sepal.Length + Sepal.Width, centers = 3)

GarrettMooney/moonmisc documentation built on Oct. 19, 2019, 7:51 p.m.