[R] Problem to predict new data with mclust

Sarah Goslee sarah.goslee at gmail.com
Tue Dec 10 16:30:06 CET 2013


Hi,

It's unlikely that anyone will be able to see your problem without a
reproducible example.

http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

Are you using the mclust package? That would be the first thing we need to know.

Then, have you worked through the examples in ?predict.Mclust, and do
you understand them?

Then, what do your data look like? str() and such are useful, but the
best option is to use dput() to create a reproducible subset, or to
reproduce your problem using one of the built-in datasets in R, as is
done in the above documentation examples.

Sarah

On Tue, Dec 10, 2013 at 6:41 AM, Welma Pereira <welma.pereira at gmail.com> wrote:
> Hi,
>
> I am trying to use mclust to cluster some data (train_pca_10), I get the
> clusters, but when I try to use the model to predict new data (test1) I get
> this error
>
>
>
> mClust2 <- Mclust(train_pca_10,G=2)
> pred<-predict.Mclust(mClust2,test1)
>
> Error in if (warn) warning(WARNING) : argument is of length zero
>
> Can anyone see the problem here?
>
> Thanks,
> Pereira.
>
-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list