s-news
[Top] [All Lists]

Re: converting data type from data.frame to matrix or vector

To: "Terrence Murphy" <Terrence.Murphy@yale.edu>, <s-news@lists.biostat.wustl.edu>
Subject: Re: converting data type from data.frame to matrix or vector
From: "Stewart, William" <william.stewart@rbc.com>
Date: Fri, 2 Dec 2005 13:27:28 -0500
Thread-index: AcX3bM/Ekzi1NxKXTZ6iiJloEO4ecwAALw2g
Thread-topic: [S] converting data type from data.frame to matrix or vector
Assuming 'my.data' is a data.frame object then data.matrix(my.data) should do 
the job.

Be careful that all elements of your data frame are compatible (i.e. all 
numeric) or you may get weird results.

-------------------------
William A. Stewart
Manager, Operational Risk
RBC Financial Group
william.stewart@rbc.com
phone: 416-974-3019



-----Original Message-----
From: s-news-owner@lists.biostat.wustl.edu
[mailto:s-news-owner@lists.biostat.wustl.edu]On Behalf Of Terrence
Murphy
Sent: Friday, December 02, 2005 1:18 PM
To: s-news@lists.biostat.wustl.edu
Subject: [S] converting data type from data.frame to matrix or vector


folks,

I'm creating column vectors and matrices of data in SAS and then importing 
them individually into Splus.

When I do this each item has data type "data.frame"  and I want to convert 
some of them into data type "matrix" and others into data type "vector".

Is there a quick and easy way to do this? I've been playing with menu and 
dialog boxes to no avail.

thanks,

Terrence E. Murphy, Ph.D.
Program on Aging
Yale University
1 Church St., 7th Floor
New Haven, CT 06437
terrence.murphy@yale.edu
phone: 203-764-9805
fax:      203-764-9831 

--------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu.  To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
the BODY of the message:  unsubscribe s-news
_______________________________________________________________________

This e-mail may be privileged and/or confidential, and the sender does not 
waive any related rights and obligations.
Any distribution, use or copying of this e-mail or the information it contains 
by other than an intended recipient is unauthorized.
If you received this e-mail in error, please advise me (by return e-mail or 
otherwise) immediately.  

Ce courrier électronique est confidentiel et protégé. L'expéditeur ne renonce 
pas aux droits et obligations qui s'y rapportent.
Toute diffusion, utilisation ou copie de ce message ou des renseignements qu'il 
contient par une personne autre que le (les) destinataire(s) désigné(s) est 
interdite.
Si vous recevez ce courrier électronique par erreur, veuillez m'en aviser 
immédiatement, par retour de courrier électronique ou par un autre moyen.

Attachment: Stewart, William.vcf
Description: Stewart, William.vcf

<Prev in Thread] Current Thread [Next in Thread>