[R] function

Andrew C. Ward s195404 at student.uq.edu.au
Wed Feb 19 05:24:03 CET 2003


!is.na(match(myvec, myscaler)) is probably what you want.

Regards,

Andrew C. Ward

CAPE Centre
Department of Chemical Engineering
The University of Queensland
Brisbane Qld 4072 Australia
andreww at cheque.uq.edu.au



Quoting skayis at lic.co.nz:

> Dear R users,
> 
> I have some R code and trying to understand it. I have a vector
> 
>  myvec
>  [1] 24 24 10 10 10 10 10 44 44 44 45 45 45 54 54 54 54 42 42
> 
> and a scaler
> 
>  myscaler
> [1] 10
> 
> The following function:
> match(myvec,myscaler)!="NA"
> 
>  returns :
> 
>  [1]   NA   NA TRUE TRUE TRUE TRUE TRUE   NA   NA   NA   NA   NA   NA   NA
> NA   NA   NA   NA    NA
> 
> I need a return
> 
> FALSE  FALSE TRUE TRUE TRUE TRUE TRUE   FALSE FALSE ...FALSE
> 
> Is there any function to perform this?
> 
> Any help deeply appreciated.
> 
> Kind Regards
> 
> Seyit Ali
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> http://www.stat.math.ethz.ch/mailman/listinfo/r-help
>




More information about the R-help mailing list