[R] creating matrices from vectors

From: James Rudge <james_980_at_hotmail.com>
Date: Sat, 15 Nov 2008 15:17:30 +0000

If I have 4 vectors (a, b, c, and d) each of length 1000, how do I then create 1000 two by two matrices from these vectors, such that:  

myMatrix[i] = matrix(c(a[i],b[i],c[i],d[i]),2)  

Then I'd like to create a single vector containing the largest eigenvalues of each matrix?  

(Sorry I am quite new to R)
Many thanks,
James  



[[elided Hotmail spam]]

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat 15 Nov 2008 - 15:20:07 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 Sat 15 Nov 2008 - 18:30:26 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive