> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of David Freedman
> Sent: Friday, May 01, 2009 11:52 AM
> To: r-help@r-project.org
> Subject: [R] sequence number for 'long format'
>
>
> D
Try this:
ds$seq <- ave(ds$id, ds$id, FUN = seq_along)
On Fri, May 1, 2009 at 2:52 PM, David Freedman <3.14da...@gmail.com> wrote:
>
> Dear R-help list,
>
> I've got a data set in long format - each subject can have several (varying
> in number) measurements, with each record representing one me
Dear R-help list,
I've got a data set in long format - each subject can have several (varying
in number) measurements, with each record representing one measurement. I
want to assign a sequence number to each measurement, starting at 1 for a
person's first measurement. I can do this with the by
3 matches
Mail list logo