Could you repaste your data using dput() so we can see exactly what we are working with here.
As things stand currently, I can't tell why it doesn't suffice to just combine the dates and times into POSIX objects and subtract them all from the first row. For more information on that approach, try ?as.POSIXct from the base package. Hope this helps, Michael Weylandt On Sat, Sep 17, 2011 at 10:39 PM, Ayyappa Chaturvedula <ayyapp...@gmail.com>wrote: > Dear Group, > > Can you help me solve the problem with calculating Time Post dose using > date > time fomat? Here is information for subject 1 and I appreciate your help > for code to generate time post dose from the first dose in each individual. > > > Thank you in advance. > > Regards, > Ayyappa > > ID DATE TIME 1 2/25/2010 14:51 1 2/26/2010 20:26 1 2/27/2010 > 9:00 1 2/27/2010 21:34 1 2/28/2010 8:18 1 2/28/2010 21:00 1 3/1/2010 > 9:00 1 3/1/2010 9:20 > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.