git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/MineICA@73179 bc3139a8-67e5-0310-9ffc-ced21a209358
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,58 @@ |
1 |
+\name{plotAllMix} |
|
2 |
+\alias{plotAllMix} |
|
3 |
+\title{Plots the Gaussian fitted by \code{Mclust} on several numeric vectors} |
|
4 |
+\usage{ |
|
5 |
+ plotAllMix(mc, A, nbMix = NULL, pdf, nbBreaks = 20, |
|
6 |
+ xlim = NULL) |
|
7 |
+} |
|
8 |
+\arguments{ |
|
9 |
+ \item{mc}{A list consisting of outputs of function |
|
10 |
+ \code{Mclust} applied to each column of \code{A}, if this |
|
11 |
+ argument is missing \code{Mclust} is applied by the |
|
12 |
+ function.} |
|
13 |
+ |
|
14 |
+ \item{A}{A data.frame of dimensions 'samples x |
|
15 |
+ components'.} |
|
16 |
+ |
|
17 |
+ \item{nbMix}{The number of Gaussian to be fitted.} |
|
18 |
+ |
|
19 |
+ \item{nbBreaks}{The number of breaks for the histogram.} |
|
20 |
+ |
|
21 |
+ \item{xlim}{x-axis limits to be used in the plot.} |
|
22 |
+ |
|
23 |
+ \item{pdf}{A pdf file.} |
|
24 |
+} |
|
25 |
+\value{ |
|
26 |
+ A list of \code{Mclust} results. |
|
27 |
+} |
|
28 |
+\description{ |
|
29 |
+ Given a result of function \code{Mclust} applied on |
|
30 |
+ several numeric vectors, this function plots the fitted |
|
31 |
+ Gaussian on their histograms. |
|
32 |
+} |
|
33 |
+\details{ |
|
34 |
+ This function can only deal with at the most three |
|
35 |
+ Gaussian |
|
36 |
+} |
|
37 |
+\examples{ |
|
38 |
+A <-matrix(c(c(rnorm(80,mean=-0.5,sd=1),rnorm(80,mean=1,sd=0.2)),rnorm(160,mean=0.5,sd=1), |
|
39 |
+ c(rnorm(80,mean=-1,sd=0.3),rnorm(80,mean=0,sd=0.2))),ncol=3) |
|
40 |
+## apply function Mclust to each column of A |
|
41 |
+mc <- apply(A,2,Mclust) |
|
42 |
+## plot the corresponding Gaussians on the histogram of each column |
|
43 |
+plotAllMix(mc=mc,A=A) |
|
44 |
+## apply function Mclust to each column of A, and impose the fit of two Gaussian (G=2) |
|
45 |
+mc <- apply(A,2,Mclust,G=2) |
|
46 |
+## plot the corresponding Gaussians on the histogram of each column |
|
47 |
+plotAllMix(mc=mc,A=A) |
|
48 |
+## When arg 'mc' is missing, Mclust is applied by the function |
|
49 |
+plotAllMix(A=A) |
|
50 |
+} |
|
51 |
+\author{ |
|
52 |
+ Anne Biton |
|
53 |
+} |
|
54 |
+\seealso{ |
|
55 |
+ \code{\link{plotMix}}, \code{\link{hist}}, |
|
56 |
+ \code{\link[mclust]{Mclust}} |
|
57 |
+} |
|
58 |
+ |