Re: [R] convert a data.frame to matrix

2013-05-17 Thread peter dalgaard
On May 17, 2013, at 01:59 , David Winsemius wrote: On May 16, 2013, at 1:46 PM, Hermann Norpois wrote: Hello, I fail to tranfer data from a dataframe to a matrix. jam is from a dataframe (and belongs still to the class dataframe) and should look like m (see below). jam vec1 vec3

Re: [R] convert a data.frame to matrix

2013-05-16 Thread Sarah Goslee
Why not simply: matrix(jam, ncol=2) [,1] [,2] [1,] 172 223 [2,] 173 356 On Thu, May 16, 2013 at 4:46 PM, Hermann Norpois hnorp...@gmail.com wrote: Hello, I fail to tranfer data from a dataframe to a matrix. jam is from a dataframe (and belongs still to the class dataframe) and

Re: [R] convert a data.frame to matrix

2013-05-16 Thread David Winsemius
On May 16, 2013, at 1:46 PM, Hermann Norpois wrote: Hello, I fail to tranfer data from a dataframe to a matrix. jam is from a dataframe (and belongs still to the class dataframe) and should look like m (see below). jam vec1 vec3 d1 d2 1 172 173 223 356 dput (jam)