[R] Matrixes as data

2009-10-16 Thread Kjetil Halvorsen
Hola! I am working on a problem where data points are (square) matrices. Is there a way to make a vector of matrices, such that it can be stored in a data.frame? Can that be done with S3? or do I have to learn S4 objects methods? Kjetil __

Re: [R] Matrixes as data

2009-10-16 Thread Barry Rowlingson
On Fri, Oct 16, 2009 at 4:36 PM, Kjetil Halvorsen kjetilbrinchmannhalvor...@gmail.com wrote: Hola! I am working on a problem where data points are (square) matrices. Is there a way to make a vector of matrices, such that it can be stored in a data.frame? Can that be done with S3? or do I

Re: [R] Matrixes as data

2009-10-16 Thread Kjetil Halvorsen
Thanks. The points of having the column of matrices (all the same dimension) in a data.frame, is that there are also other data, each matrix is at a location, so there are geographical coordinates and possibly other measurements at the same location. Kjetil On Fri, Oct 16, 2009 at 12:46 PM,

Re: [R] Matrixes as data

2009-10-16 Thread Ben Bolker
Magnus Torfason-2 wrote: Hola! I am working on a problem where data points are (square) matrices. Is there a way to make a vector of matrices, such that it can be stored in a data.frame? I agree with previous posters that in most cases, you would want to store matrices in

Re: [R] Matrixes as data

2009-10-16 Thread Gabor Grothendieck
Create a matrix out of a list. In this example column 1 contains matrices, column 2 contains the number 1 and 2 and column 3 contains letters: L - matrix(list(m, m+10, 1, 2, a, b), 2); L [,1] [,2] [,3] [1,] Integer,4 1a [2,] Numeric,4 2b L[[2,1]] [,1] [,2] [1,] 11 13