Re: [R] Count Code

2009-04-23 Thread Bronagh Grimes
Many thanks for this, I will try this code. Much appreciated. -Original Message- From: Peter Dalgaard [mailto:p.dalga...@biostat.ku.dk] Sent: 22 April 2009 22:05 To: David Winsemius Cc: Bronagh Grimes; r-help@r-project.org Subject: Re: [R] Count Code David Winsemius wrote: > >

Re: [R] Count Code

2009-04-22 Thread Peter Dalgaard
David Winsemius wrote: On Apr 22, 2009, at 3:42 PM, Bronagh Grimes wrote: Hi there, I am interested in converting SAS code to R & I wondered if anyone had any quick R code/tips for the following piece of test SAS code? Any feedback greatly appreciated. data A1; set A1; count + 1; by subj

Re: [R] Count Code

2009-04-22 Thread David Winsemius
On Apr 22, 2009, at 3:42 PM, Bronagh Grimes wrote: Hi there, I am interested in converting SAS code to R & I wondered if anyone had any quick R code/tips for the following piece of test SAS code? Any feedback greatly appreciated. data A1; set A1; count + 1; by subject_id; if first.subjec

[R] Count Code

2009-04-22 Thread Bronagh Grimes
Hi there, I am interested in converting SAS code to R & I wondered if anyone had any quick R code/tips for the following piece of test SAS code? Any feedback greatly appreciated. data A1; set A1; count + 1; by subject_id; if first.subject_id then count = 1; run;