[R] vector to matrix transformation

Sean Davis sdavis2 at mail.nih.gov
Fri Dec 3 12:25:12 CET 2004

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 problem and I just gave up. Did anyone 
> knows how to transform a matrix into a vector and back-transform a 
> vector into a matrix?

See ?as.vector and ?matrix.  Do those answer your question?  If not, 
perhaps you could give a bit more detail of what you have tried.


More information about the R-help mailing list