On 25-Nov-04 John wrote:
> Hello R-users,
> 
> I have a symmetric matrix of numerical values and I
> want to obtain those values in the upper or lower
> triangle of the matrix in a vector. I tried to do the
> job by using two for-loops but it doens't seem to be a
> clever way, and I'd like to know a more efficient code
> for a large matrix of thousands of rows and columns.

The two functions uuper.tri and lower.tri do just this job!

Best wishes,
Ted.


--------------------------------------------------------------------
E-Mail: (Ted Harding) <[EMAIL PROTECTED]>
Fax-to-email: +44 (0)870 094 0861  [NB: New number!]
Date: 25-Nov-04                                       Time: 18:54:20
------------------------------ XFMail ------------------------------

______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to