Re: [R] Computing row differences in new columns

2011-03-21 Thread Roberto Lodeiro Muller
-Original Message- From: Roberto Lodeiro Muller To: roberto.mul...@doctor.com Sent: Mon, Mar 21, 2011 3:37 pm Subject: Re: [R] Computing row differences in new columns Sorry, my data appeared badly formatted to me, so I converted it to plain text: And just to clarify, for each

[R] Computing row differences in new columns

2011-03-21 Thread Roberto Lodeiro Muller
Hi I have the following columns with dates and results, sorted by subject and date. I'd like to compute the differences in dates and results for each patient, based on the previous row. Obviously the last entry for each subject should be a NA. Which would be the best way to accomplished tha