plotMix | R Documentation |
Mclust
Given a result of function Mclust
applied to a
numeric vector, this function draws the fitted Gaussian
on the histogram of the data values.
plotMix(mc, data, nbBreaks, traceDensity = TRUE,
title = "", xlim, ylim, ...)
mc |
The result of Mclust function applied to
argument |
data |
A vector of numeric values |
nbBreaks |
The number of breaks for the histogram |
traceDensity |
If TRUE (default) density are displayed on the y-axis, else if FALSE counts are displayed on the y-acis |
title |
A title for the plot |
xlim |
x-axis limits to be used in the plot |
ylim |
y-axis limits to be used in the plot |
... |
additional arguments for hist |
A shapiro test p-value is added to the plot title. This function can only deal with at the most three Gaussian.
NULL
Anne Biton
hist
, Mclust
## create a mix of two Gaussian
v <-c(rnorm(80,mean=-0.5,sd=1),rnorm(80,mean=1,sd=0.2))
## apply Mclust
mc <- Mclust(v)
## plot fitted Gaussian on histogram of v
plotMix(mc=mc,data=v,nbBreaks=30)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.