Learn R Programming

useful (version 1.2.0)

PlotHartigan: Plot a series of Hartigan's Numbers

Description

After fitting a series of Hartigan's Numbers (see FitKMeans) this will plot the results so it is easy to visualize

Usage

PlotHartigan(hartigan, title = "Hartigan's Rule", smooth = FALSE,
  linecolor = "grey", linetype = 2L, linesize = 1L, minor = TRUE)

Arguments

hartigan
The results from FitKMeans
title
Title to be used in the plot
smooth
logical; if true a smoothed line will be fit to the points, otherwise it will be a piecewise line
linecolor
Color of the horizontal line denoting 10
linetype
Type of the horizontal line denoting 10
linesize
Size of the horizontal line denoting 10
minor
logical; if true minor grid lines will be plotted

Value

  • a ggplot object

Details

Displays a graphical representation of the results of FitKMeans

References

#' http://www.stat.columbia.edu/~madigan/DM08/descriptive.ppt.pdf

See Also

kmeans FitKMeans

Examples

Run this code
data(iris)
hartiganResults <- FitKMeans(iris[, -ncol(iris)])
PlotHartigan(hartiganResults)

Run the code above in your browser using DataLab