[R] Output of clustering packages

Martin Maechler maechler at stat.math.ethz.ch
Thu Jun 13 15:13:22 CEST 2002


>>>>> "AbMa" == Aboubakar Maitournam <amaitour at pasteur.fr> writes:

    AbMa> Dear all, I am sorry because my question is perhaps
    AbMa> trivial and is certainly a detail.  It's related to
    AbMa> the output of some clustering package as mclust and
    AbMa> e1071. The output is as follows :

 [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
 [38] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
 [75] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
[112] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1
[149] 1 1

    AbMa> where [n] is the label of individual and 1, 2, 3 are
    AbMa> the index of classes.

    AbMa> How to get the output in the form 
[1] 1 
[2] 2 
.  
.  
.
    AbMa> I have tried to use write.table without success.

The answer is  cbind() : it makes a 1-column matrix from your vector
Try

 ii <- 1 + rpois(50, lam= 1)
 cbind(ii)

{and of course this has nothing to do with clustering ...}

    AbMa> Thank you in advance.

you're welcome

    AbMa> Aboubakar Maitournam.

Martin Maechler <maechler at stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO C16	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list