Re: [R] Function for describing segements in sequential data

2010-01-27 Thread Charles C. Berry
On Wed, 27 Jan 2010, Gregory Gentlemen wrote: Dear R-users, Say that I have a sequence of zeroes and ones: x <- c(1,1,1,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0) The sequences of ones represent segments and I want to report the starting and endpoints of these segments. For example, in 'x', the fi

Re: [R] Function for describing segements in sequential data

2010-01-27 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Gregory Gentlemen > Sent: Wednesday, January 27, 2010 9:31 AM > To: r-help@r-project.org > Subject: [R] Function for describing segements in sequential data

Re: [R] Function for describing segements in sequential data

2010-01-27 Thread Steve Lianoglou
Hi, On Wed, Jan 27, 2010 at 12:31 PM, Gregory Gentlemen wrote: > Dear R-users, > > Say that I have a sequence of zeroes and ones: > > x <- c(1,1,1,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0) > > The sequences of ones represent segments and I want to report the starting > and endpoints of these segments

[R] Function for describing segements in sequential data

2010-01-27 Thread Gregory Gentlemen
Dear R-users, Say that I have a sequence of zeroes and ones: x <- c(1,1,1,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0) The sequences of ones represent segments and I want to report the starting and endpoints of these segments. For example, in 'x', the first segment starts at location 1 and ends at 3,