Message-ID: <CAAxdm-62D60Ep7sv3ncg0p-ryJza0e2Cg1z6qHU5-NRM+Y6=LQ@mail.gmail.com>
Date: 2014-08-07T09:16:46Z
From: jim holtman
Subject: ask for help
In-Reply-To: <1261d9ca.3029.147ae3cee9d.Coremail.johnnycz@yeah.net>
rle
Jim Holtman
Data Munger Guru
What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.
On Wed, Aug 6, 2014 at 10:12 PM, Johnnycz <johnnycz at yeah.net> wrote:
> Hello,everybody,
> I have a sequence,like a<-c(1,1,1,0,0,1,1,1,1,1,1,0,0,0,0,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1),how to get the position of each first 1 and 0, that's to say, how to get b<-c(1,6,16,23) for first 1 and d<-c(4,12,18) for first 0.
> Many thanks!
> Johnny
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.