Re: [R] Expanding a data structure

2010-03-01 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Worik R > Sent: Sunday, February 28, 2010 9:37 PM > To: r-help > Subject: Re: [R] Expanding a data structure > > > change <- c(NA, diff(q1$..1

Re: [R] Expanding a data structure

2010-02-28 Thread Worik R
> change <- c(NA, diff(q1$..1)) > will be 1 when ..1 goes from FALSE > to TRUE, -1 for TRUE to FALSE, 0 for no change, and NA > for the first element. You may find it convenient to > change that NA to something else or to not deal with > the first element after computing the diff. > > This is ve

Re: [R] Expanding a data structure

2010-02-28 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Worik R > Sent: Sunday, February 28, 2010 5:22 PM > To: r-help > Subject: [R] Expanding a data structure > > I have a xts object with logical data . > > > tail(q1) >