Skip to content
Back to formatted view

Raw Message

Message-ID: <26273390.post@talk.nabble.com>
Date: 2009-11-09T20:47:24Z
From: Grzes
Subject: Find the first values in vector
In-Reply-To: <de4e29f50911091144r68a264e3o4acb492f77793bbc@mail.gmail.com>

Thank You All Very Much   :jumping:



baptiste auguie-5 wrote:
> 
> Hi,
> 
> One way would be,
> 
> vec[ cumsum(!vec)==0 ]
> 
> HTH,
> 
> baptiste
> 
> 2009/11/9 Grzes <gregorio99 at gmail.com>:
>>
>> Hi !
>> I have a vector:
>> vec= TRUE ?TRUE ?TRUE ?TRUE FALSE FALSE FALSE FALSE TRUE ?TRUE ?FALSE
>> and I'm looking for a method which let me get only the first values equal
>> TRUE from this vector. It means that I want to get a vector:
>> vec_out = ?TRUE ?TRUE ?TRUE ?TRUE
>>
>> or posictions values = TRUE: vec_out = 1,2,3,4
>> --
>> View this message in context:
>> http://old.nabble.com/Find-the-first-values-in-vector-tp26271555p26271555.html
>> Sent from the R help mailing list archive at Nabble.com.
>>
>> ______________________________________________
>> 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.
>>
> 
> ______________________________________________
> 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.
> 
> 

-- 
View this message in context: http://old.nabble.com/Find-the-first-values-in-vector-tp26271555p26273390.html
Sent from the R help mailing list archive at Nabble.com.