Description Usage Arguments Details References Examples
View source: R/plot_cut_point.R
Returns a plot of the data density (histogram) with an overlaid cut point generated by a Gaussian mixture model
1 | plot_cut_point(m, plot = TRUE, color = c("grayscale", "amerika", "wesanderson"))
|
m |
An object of class |
plot |
A logical argument for generating the plot. If FALSE, only the cut point value from the GMM is returned. If TRUE, histogram with the overlaid cut point is returned. Default is set to TRUE. |
color |
A vector of color options including "amerika" (from package |
Gaussian mixture models are often used to derive cut points, or lines of separation between clusters in feature space (See Benaglia et al. 2009 for more). The plot_cut_point
function plots data densities with the overlaid cut point (the mean of the calculated mu
) from mixEM
objects, which are GMM's fit using the mixtools
package.
Benaglia, T., Chauveau, D., Hunter, D. and Young, D. 2009. mixtools: An R package for analyzing finite mixture models. Journal of Statistical Software, 32(6), pp.1-29.
Ram, K., and Wickham, H. 2015. wesanderson: a Wes Anderson palette generator. R package version 0.3.
1 2 3 4 5 | mixmdl <- mixtools::normalmixEM(faithful$waiting, k = 2)
plot_cut_point(mixmdl, plot = TRUE, color = "amerika") # returns plot, amerika
plot_cut_point(mixmdl, plot = TRUE, color = "wesanderson") # returns plot, wesanderson
plot_cut_point(mixmdl, plot = FALSE) # returns only the cut point value from the GMM
|
*Attention*: `plotGMM` is no longer actively developed. Instead, use the expanded package, `plotmm`. Thanks!
number of iterations= 21
Registered S3 method overwritten by 'wesanderson':
method from
print.palette amerika
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
[1] 67.35299
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.