[R] reshape from wide to long, ordering of varying

2010-10-07 Thread stefan.d...@gmail.com
Hello, I have data in the following form age sex Int.Prev.Est.1 Int.Prev.Est.2 Int.Prev.Est.3 Int.Prev.Est.4 Int.Prev.Est.5 93110 93 0 23.75482 57.86592 9.755003 4.343534 4.280714 93610 93 1 53.36475 39.47247 4.381618 1.622119 1.159044

Re: [R] reshape from wide to long, ordering of varying

2010-10-07 Thread Henrique Dallazuanna
Try this: reshape(UK.INT, direction = 'long', varying = list(grep(Int.Prev.Est, names(UK.INT On Thu, Oct 7, 2010 at 2:05 PM, stefan.d...@gmail.com stefan.d...@gmail.com wrote: Hello, I have data in the following form age sex Int.Prev.Est.1 Int.Prev.Est.2 Int.Prev.Est.3

Re: [R] reshape from wide to long, ordering of varying

2010-10-07 Thread Gabor Grothendieck
On Thu, Oct 7, 2010 at 1:05 PM, stefan.d...@gmail.com stefan.d...@gmail.com wrote: Hello, I have data in the following form      age sex Int.Prev.Est.1 Int.Prev.Est.2 Int.Prev.Est.3 Int.Prev.Est.4 Int.Prev.Est.5 93110  93   0       23.75482       57.86592       9.755003 4.343534      

Re: [R] reshape from wide to long, ordering of varying

2010-10-07 Thread stefan.d...@gmail.com
Thanks a lot! Both solutions work great! On Thu, Oct 7, 2010 at 7:19 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Thu, Oct 7, 2010 at 1:05 PM, stefan.d...@gmail.com stefan.d...@gmail.com wrote: Hello, I have data in the following form      age sex Int.Prev.Est.1 Int.Prev.Est.2