Re: [R] converting each column of a data frame into a matrix with n rows

2017-05-18 Thread Davide Piffer
>>> $ X10: int [1:2, 1:5] 91 92 93 94 95 96 97 98 99 100 >>> >>> >>> ------------- >>> David L Carlson >>> Department of Anthropology >>> Texas A&M University >>> College Station, TX 77840-4352 >

Re: [R] converting each column of a data frame into a matrix with n rows

2017-05-17 Thread David Winsemius
[1:2, 1:5] 91 92 93 94 95 96 97 98 99 100 >> >> >> - >> David L Carlson >> Department of Anthropology >> Texas A&M University >> College Station, TX 77840-4352 >> >> >> -Original Message

Re: [R] converting each column of a data frame into a matrix with n rows

2017-05-17 Thread Davide Piffer
iversity > College Station, TX 77840-4352 > > > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Davide Piffer > Sent: Wednesday, May 17, 2017 2:18 PM > To: r-help@r-project.org > Subject: [R] converting each column of a data frame int

Re: [R] converting each column of a data frame into a matrix with n rows

2017-05-17 Thread David L Carlson
ation, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Davide Piffer Sent: Wednesday, May 17, 2017 2:18 PM To: r-help@r-project.org Subject: [R] converting each column of a data frame into a matrix with n rows I need to convert each vector

Re: [R] converting each column of a data frame into a matrix with n rows

2017-05-17 Thread David Winsemius
> On May 17, 2017, at 12:18 PM, Davide Piffer wrote: > > I need to convert each vector of a dataframe into a matrix with 2 rows > and 2 columns (i.e. contingency table). > Note I don't want to convert the entire df into a matrix! I want to > apply a function that converts each 4 elements vector

[R] converting each column of a data frame into a matrix with n rows

2017-05-17 Thread Davide Piffer
I need to convert each vector of a dataframe into a matrix with 2 rows and 2 columns (i.e. contingency table). Note I don't want to convert the entire df into a matrix! I want to apply a function that converts each 4 elements vector of a df into a 2 x 2 matrix. I wrote something like this, but it