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 1"a" [2,] Numeric,4 2"b" > L[[2,1]] [,1] [,2] [1,]

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 > sto

Re: [R] Matrixes as data

2009-10-16 Thread Magnus Torfason
> 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 a list. However, if you already have

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, Barry

Re: [R] Matrixes as data

2009-10-16 Thread Steve Lianoglou
Bonjour, On Oct 16, 2009, at 11:36 AM, Kjetil Halvorsen 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 have to learn S4 objects & method

Re: [R] Matrixes as data

2009-10-16 Thread Barry Rowlingson
On Fri, Oct 16, 2009 at 4:36 PM, Kjetil Halvorsen 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 have to learn S4 objects & me

[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 __ R-help@r