Re: [R] Filling in a series

2006-10-21 Thread Gabor Grothendieck
Actually I think its last _observation_ carried forward. On 10/21/06, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > The zoo package has na.locf (last occurrernce carried foward) > for this purpose: > > > x > [1] 1 NA NA NA NA 2 NA NA NA NA 3 NA NA > > library(zoo) > > na.locf(x) > [1] 1 1 1

Re: [R] Filling in a series

2006-10-21 Thread Gabor Grothendieck
The zoo package has na.locf (last occurrernce carried foward) for this purpose: > x [1] 1 NA NA NA NA 2 NA NA NA NA 3 NA NA > library(zoo) > na.locf(x) [1] 1 1 1 1 1 2 2 2 2 2 3 3 3 On 10/21/06, Dennis Fisher <[EMAIL PROTECTED]> wrote: > Colleagues > > After reading in some clinical data, I

[R] Filling in a series

2006-10-21 Thread Dennis Fisher
Colleagues After reading in some clinical data, I discovered that the subject ID column contains entries only for the first record for each individual; subsequent rows are recorded as NA. For example: > 1 > NA > NA > NA > NA > 2 > NA > NA > NA > NA > 3 > NA > NA > ... I can think of various