Re: [R] help on data frame and matrix

2006-09-18 Thread Martin Maechler
 John == John Kane [EMAIL PROTECTED]
 on Sun, 17 Sep 2006 12:10:19 -0400 (EDT) writes:

John --- Finosaur [EMAIL PROTECTED] wrote:

 I am given a data frame, which actually contains a
 matrix. But I need to convert the data frame into a
 matrix so that I can use the matrix operators. Can
 anybody help me out? Thanks a lot.
 
 
 Thaleia

John  d - as.matrix(data.frame)

It's (almost always) better to use Dimitri's suggestion,
data.matrix(), since that also produces a numeric matrix when
the data frame contains factors.

Martin

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] help on data frame and matrix

2006-09-17 Thread Dimitrios Rizopoulos
look at ?data.matrix()

Best,
Dimitris


Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://med.kuleuven.be/biostat/
  http://www.student.kuleuven.be/~m0390867/dimitris.htm


Quoting Finosaur [EMAIL PROTECTED]:


 Hey,



 I am given a data frame, which actually contains a matrix. But I   
 need to convert the data frame into a matrix so that I can use the   
 matrix operators. Can anybody help me out? Thanks a lot.



 Thaleia

   [[alternative HTML version deleted]]

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.





Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] help on data frame and matrix

2006-09-17 Thread John Kane

--- Finosaur [EMAIL PROTECTED] wrote:


 I am given a data frame, which actually contains a
 matrix. But I need to convert the data frame into a
 matrix so that I can use the matrix operators. Can
 anybody help me out? Thanks a lot.
 
  
 
 Thaleia
 d - as.matrix(data.frame)

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.