[R] matrix in data.frame

2007-05-30 Thread Lina Hultin-Rosenberg
Dear list! I have run into a problem that seems very simple but I can't find any solution to it (have searched the internet, help-files and An introduction to R etc without any luck). The problem is the following: I would like to create a data.frame with two components (columns), the first

Re: [R] matrix in data.frame

2007-05-30 Thread michael watson \(IAH-C\)
10 x$b [1] 1 2 3 4 5 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lina Hultin-Rosenberg Sent: 30 May 2007 10:26 To: r-help@stat.math.ethz.ch Subject: [R] matrix in data.frame Dear list! I have run into a problem that seems very simple but I can't

Re: [R] matrix in data.frame

2007-05-30 Thread Prof Brian Ripley
You need to use I() or something similar. E.g. A - matrix(1:6, 2,3) data.frame(x=1:2, I(A)) X - data.frame(x=1:2) X$A - A both insert A as a single column. On Wed, 30 May 2007, Lina Hultin-Rosenberg wrote: Dear list! I have run into a problem that seems very simple but I can't find any

Re: [R] matrix in data.frame

2007-05-30 Thread Lina Hultin-Rosenberg
Thank you so much for your help, it worked of course! Best regards, Lina Hultin-Rosenberg -Ursprungligt meddelande- Från: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Skickat: den 30 maj 2007 12:44 Till: Lina Hultin-Rosenberg Kopia: r-help@stat.math.ethz.ch Ämne: Re: [R] matrix