which ( abs(V - 9) <= 3 )
Sent from my iPad
On Jun 28, 2013, at 17:58, Julio Sergio wrote:
> One of the techniques to subset, a vector for instance, is the following:
>
> V <- c(18, 8, 5, 41, 8, 7)
> V
> ## [1] 18 8 5 41 8 7
> ( I <- abs(V - 9) <= 3 )
> ## [1] FALSE TRUE FALSE FALSE
r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
> Behalf
> Of Bert Gunter
> Sent: Friday, June 28, 2013 5:01 PM
> To: Julio Sergio
> Cc: r-h...@stat.math.ethz.ch
> Subject: Re: [R] Transforming boolean subsetting into index subsetting
>
> ?which
>
?which
-- Bert
On Fri, Jun 28, 2013 at 2:58 PM, Julio Sergio wrote:
> One of the techniques to subset, a vector for instance, is the following:
>
> V <- c(18, 8, 5, 41, 8, 7)
> V
> ## [1] 18 8 5 41 8 7
> ( I <- abs(V - 9) <= 3 )
> ## [1] FALSE TRUE FALSE FALSE TRUE TRUE
> V[I]
On Jun 28, 2013, at 23:58 , Julio Sergio wrote:
> One of the techniques to subset, a vector for instance, is the following:
>
> V <- c(18, 8, 5, 41, 8, 7)
> V
> ## [1] 18 8 5 41 8 7
> ( I <- abs(V - 9) <= 3 )
> ## [1] FALSE TRUE FALSE FALSE TRUE TRUE
> V[I]
> ## [1] 8 8 7
>
> Howe
One of the techniques to subset, a vector for instance, is the following:
V <- c(18, 8, 5, 41, 8, 7)
V
## [1] 18 8 5 41 8 7
( I <- abs(V - 9) <= 3 )
## [1] FALSE TRUE FALSE FALSE TRUE TRUE
V[I]
## [1] 8 8 7
However, sometimes we are interested in the indexes of the elements w
5 matches
Mail list logo