[R] data.frame -> matrix

Roger D. Peng rpeng at jhsph.edu
Sat Sep 27 16:43:47 CEST 2003


I think data.matrix() is what you want.

-roger

Sokratis Alikhanidi wrote:
>    Dear colleagues,
> 
> I am beginner, so the primitive questions:
> in pls.pcr package in the function mvr I need to indicate a matrix of observations and a vector of responses.
> But read.table function returns the data.frame object.
> 
> What is the way for conversion of the data.frame object into matrix and vector objects?
> 
> And what is the way for writing the results down into file?
> 
> Thank you very much.
> 
> Sokratis.
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>




More information about the R-help mailing list