s-news
[Top] [All Lists]

[S] summary triangular matrix

To: s-news@wubios.wustl.edu
Subject: [S] summary triangular matrix
From: Winson Taam <taam@Oakland.edu>
Date: Mon, 31 Jan 2000 20:20:40 -0500 (EST)
Sender: owner-s-news@wubios.wustl.edu
Thank you all for replying to my question. I knew my question was too
simply when I received 10 replies within an hour. I would like to thank
Andy White, Bill Dunlap, S.D. Byers, Bert Gunter, Ed Kademan, Andy Liaw,
Franz Mueter, Samuel Buttrey, Peter Ellis and Julian Taylor for their
suggestions. Among all the suggestions, I found Bill Dunlap's reply
closest to my need. Since the row of values that I need comes from a data
frame, the following solution works well for me.
 
tmp <- matrix(0,nt,nt)
tmp[ lower.tri(tmp) ] <- as.matrix( mydata[onerow, start:end] )
tmp <- tmp + t(tmp)

Now tmp is a symmetric matrix of distances / dis-similarities ready
for multidimensional scaling operation. Note that
as.numeric( mydata[onerow, start:end] ) and
         c( mydata[onerow, start:end] ) do not work for data frame. 
Thanks again for all the suggestions.

Winson Taam
Department of Math. & Stat.
Oakland University
Rochester, MI 48309

tel: 248-370-3438

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>
  • [S] summary triangular matrix, Winson Taam <=