kMeansClusterize: Function to assign K-Means cluster number to each row of data

Description Usage Arguments Value

Description

This will create a new column, called "clusterNum", with a numeric value for each row of data. It assumes that the first column has the identifying information, and that the rest of the columns are numeric.

It automatically removes columns that have 0 variation, and abbreviates the column names.

The columns used in the dataframe must already be numeric values, and they should already be standardized.

Usage

1
2
kMeansClusterize(clusterData, appendDataTo, nc = 5, heatMap = F,
  corrplot = F)

Arguments

clusterData

The name of the dataframe whose columns will be clustered. The first column should be the primary key.

appendDataTo

The name of the dataframe to which the "clusterNum" column will be added.

nc

The number of clusters to create. Defaults to 5.

heatMap

True/False indicator if you want to display a heatmap of cluster centroids. Defaults to False.

corrplot

True/False indicator for displaying a correlation plot of columns. Defaults to False.

Value

New column to a dataframe, and optional plots.


RonGuymon/ronsFunctions documentation built on May 8, 2019, 11:42 a.m.