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,]
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
> 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
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
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
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
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
7 matches
Mail list logo