Re: [R] matrix export

From: Sean Davis <sdavis2_at_mail.nih.gov>
Date: Fri 20 Jan 2006 - 06:09:47 EST

On 1/19/06 2:05 PM, "Eric Pante" <ericpante@hotmail.com> wrote:

> Thanks, Bert
>
> write.table won't do the trick, because distance matrices in R are
> presented as lower triangular matrices. write.table "cannot coerce
> class "dist" into a data.frame".
>
> maybe there is a way to transform the lower triangular matrix into a
> full matrix, and then use write.table ?

Did you try as.matrix()?

>From the dist() help page:

     'as.dist()' is a generic function.  Its default method handles
     objects inheriting from class '"dist"', or coercible to matrices
     using 'as.matrix()'.


Sean



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Jan 20 06:17:42 2006

This archive was generated by hypermail 2.1.8 : Fri 20 Jan 2006 - 10:10:14 EST