Re: [R] Exporting data to a text file

From: Don MacQueen <>
Date: Wed, 06 Aug 2008 14:08:04 -0700

You could try using sink() instead of write.table() to append the clustering .

print( myclara$clustering )

That will definitely append clustering to the file.


At 6:49 PM +0200 8/1/08, pacomet wrote:
>HI R users
>With clara function I get a data frame (maybe this is not the exact word,
>I'm new to R) with the following variables:
>> names(myclara)
> [1] "sample" "medoids" "" "clustering" "objective"
> [6] "clusinfo" "diss" "call" "silinfo" "data"
>I want to export "clustering" and "data" to a new text file so I try
> > write.table(myclara$data,"cluster.dat")
> > write.table(myclara$clustering,"cluster.dat",append=TRUE)
>Variable data is properly exported but clustering is not appended to the
>output file.
>Please, where is the mistake? is it possible to export the two variables in
>just a sentence?
>thanks in advance
>El ponent la mou, el llevant la plou
>Usuari Linux registrat: 363952
>Fotos: http://
> [[alternative HTML version deleted]]
> mailing list
>PLEASE do read the posting guide http:// www.
>and provide commented, minimal, self-contained, reproducible code.

Don MacQueen
Environmental Protection Department
Lawrence Livermore National Laboratory
Livermore, CA, USA

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Wed 06 Aug 2008 - 21:20:50 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 06 Aug 2008 - 22:33:20 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive