Skip to content

Separating variables in read.table

3 messages · Johannes Hüsing, Richardson, Patrick

#
If I have a table (we'll call it, "test") containing seven columns (as below):

i	x1	x2	x3	x4	x5	y
0	1.125	0.232	7.160	0.0859 8.905 1.5563
7	0.920	0.268	8.804	0.0865 7.388 0.8976
15	0.835	0.271	8.108	0.0852 5.348 0.7482
22	1.000	0.237	6.370	0.0838 8.056 0.7160
29	1.150	0.192	6.441	0.0821 6.960 0.3130
37	0.990	0.202	5.154	0.0792 5.690 0.3617
44	0.840	0.184	5.896	0.0812 6.932 0.1139
58	0.650	0.200	5.336	0.0806 5.400 0.1139


Is there a simple command to break this table into individual variables without having to code:

i <- test$i
x1 <- test$x1
x2 <- test$x2
.
.
.
And so on. . 

Many Thank for any assistance.

Patrick
This email message, including any attachments, is for th...{{dropped:6}}
#
Richardson, Patrick <Patrick.Richardson at vai.org> [Fri, Apr 17, 2009 at 09:31:35PM CEST]:
?attach

Does this do what you want?
#
Yes.

attach() was what I was needing.

Thanks to all those who replied.

Patrick


-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Johannes Huesing
Sent: Friday, April 17, 2009 4:18 PM
To: r-help at r-project.org
Subject: Re: [R] Separating variables in read.table

Richardson, Patrick <Patrick.Richardson at vai.org> [Fri, Apr 17, 2009 at 09:31:35PM CEST]:
?attach

Does this do what you want?