Re: [R] re shaping "long-form" longitudinal data from sql query

2008-04-24 Thread Gabor Grothendieck
If DF is your data frame then create a time column like this: DF$time <- ave(DF$DaysAgo, DF$PID, FUN = seq_along) and now use the reshape command on DF (or melt/cast from the reshape package). On Thu, Apr 24, 2008 at 2:13 PM, Tubin <[EMAIL PROTECTED]> wrote: > > hi, I'm a total noob who is havin

[R] re shaping "long-form" longitudinal data from sql query

2008-04-24 Thread Tubin
hi, I'm a total noob who is having to ramp up to full speed very quickly due to an unfortunate abrupt staffing change at my job :) I have longitudinal data that looks like this: PID OBSDATEDaysAgo CleanValue NAME 1 1410164934000610 8/17/2004 13:03:38