Re: [R] Vector to Matrix transformation

2007-01-24 Thread talepanda
o:[EMAIL PROTECTED] > Sent: Tuesday, January 23, 2007 8:00 PM > To: Shubha Vishwanath Karanth > Cc: r-help@stat.math.ethz.ch > Subject: Re: [R] Vector to Matrix transformation > > Shubha Vishwanath Karanth wrote: > > Hi R, > > > > I have a vector V1 of unknown len

Re: [R] Vector to Matrix transformation

2007-01-24 Thread Shubha Vishwanath Karanth
How to suppress the recycling of items in a matrix..instead NA can be filled. -Original Message- From: Chuck Cleland [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 23, 2007 8:00 PM To: Shubha Vishwanath Karanth Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Vector to Matrix

Re: [R] Vector to Matrix transformation

2007-01-23 Thread Chuck Cleland
Shubha Vishwanath Karanth wrote: > Hi R, > > I have a vector V1 of unknown length, say n. I need to convert this into > a matrix C of row size=5, and accordingly the column should be updated. > I tried with: > > C=as.matrix(V1,5,n/5) > > But it is not working...Could somebody help me on this?

Re: [R] Vector to Matrix transformation

2007-01-23 Thread Dimitris Rizopoulos
3:10 PM Subject: [R] Vector to Matrix transformation > Hi R, > > > > I have a vector V1 of unknown length, say n. I need to convert this > into > a matrix C of row size=5, and accordingly the column should be > updated. > I tried with: > > > > C=as.matrix(V

Re: [R] Vector to Matrix transformation

2007-01-23 Thread Peter Dalgaard
Shubha Vishwanath Karanth wrote: > Hi R, > > > > I have a vector V1 of unknown length, say n. I need to convert this into > a matrix C of row size=5, and accordingly the column should be updated. > I tried with: > > > > C=as.matrix(V1,5,n/5) > > > > But it is not working...Could somebody help

[R] Vector to Matrix transformation

2007-01-23 Thread Shubha Vishwanath Karanth
Hi R, I have a vector V1 of unknown length, say n. I need to convert this into a matrix C of row size=5, and accordingly the column should be updated. I tried with: C=as.matrix(V1,5,n/5) But it is not working...Could somebody help me on this? Thanks in advance... [[alte

RE: [R] vector to matrix transformation

2004-12-03 Thread Gabor Grothendieck
vector formed by stringing out the columns one after another. as.vector is similar. Date: Fri, 3 Dec 2004 11:39:57 +0100 From: Gwenael Jacob <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Subject: [R] vector to matrix transformation Dear, Some analysis (linear regression) can o

RE: [R] vector to matrix transformation

2004-12-03 Thread Andy Bunn
(*, "call")= language dist(x = x) R > class(y) [1] "dist" R > class(x) [1] "numeric" R > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Gwenael Jacob > Sent: Friday, December 03, 2004 5:40 AM >

Re: [R] vector to matrix transformation

2004-12-03 Thread Petr Pikal
On 3 Dec 2004 at 11:39, Gwenael Jacob wrote: > Dear, > > Some analysis (linear regression) can only be > done from a vectorized dataset whereas others > require a matrix (Mantel tests). I use the two > analyses and thus need to format my data in > matrix and vector. I spent some time trying

Re: [R] vector to matrix transformation

2004-12-03 Thread Sean Davis
On Dec 3, 2004, at 5:39 AM, Gwenael Jacob wrote: Dear, Some analysis (linear regression) can only be done from a vectorized dataset whereas others require a matrix (Mantel tests). I use the two analyses and thus need to format my data in matrix and vector. I spent some time trying to solve the p

[R] R: vector to matrix transformation

2004-12-03 Thread Vito Ricci
Hi, did you see: as.data.frame() as.matrix() as.vector() matrix() > x a b c 1 1 2 3 2 1 2 3 3 2 3 4 4 3 4 5 > is.data.frame(x) [1] TRUE > as.matrix(x) a b c 1 1 2 3 2 1 2 3 3 2 3 4 4 3 4 5 > y<-as.matrix(x) > is.matrix(y) [1] TRUE > as.vector(y) [1] 1 1 2 3 2 2 3 4 3 3 4 5 > z<-as.vector(y)

[R] vector to matrix transformation

2004-12-03 Thread Gwenael Jacob
Dear, Some analysis (linear regression) can only be done from a vectorized dataset whereas others require a matrix (Mantel tests). I use the two analyses and thus need to format my data in matrix and vector. I spent some time trying to solve the problem and I just gave up. Did anyone knows ho