Re: [R] table lookup n R

From: Don MacQueen <macq_at_llnl.gov>
Date: Thu 15 Jul 2004 - 00:35:02 EST

There is also the match() function, and the %in% operator, either of which might do the job, depending on your exact details. For example,

    (1:26)[letters %in% c('x','t','j')]

-Don

At 2:34 PM +0200 7/13/04, Anne wrote:
>Hello R helpers!
>I looked but did not find a table-lookup R-utility. I could use a
>loop to do the job (old FORTRAN/C habits die hard) but if I have a
>big table in which I have to search for the values corresponding to
>a vector, I end up logically with a double loop.
>Is there already such a utility? Otherwise, is there a way without loops?
>
>Thanks as always
>Anne
>----------------------------------------------------
>Anne Piotet
>Tel: +41 79 359 83 32 (mobile)
>Email: anne.piotet@m-td.com
>---------------------------------------------------
>M-TD Modelling and Technology Development
>PSE-C
>CH-1015 Lausanne
>Switzerland
>Tel: +41 21 693 83 98
>Fax: +41 21 646 41 33
>--------------------------------------------------
>
> [[alternative HTML version deleted]]
>
>______________________________________________
>R-help@stat.math.ethz.ch mailing list
>https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

-- 
--------------------------------------
Don MacQueen
Environmental Protection Department
Lawrence Livermore National Laboratory
Livermore, CA, USA

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Thu Jul 15 00:52:14 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:54:57 EST