[R] Basic Question on Keys/Values

Dumblauskas, Jerry jerry.dumblauskas at credit-suisse.com
Mon Jun 9 19:55:09 CEST 2008


As a java programmer, I'm having issue conceptualizing the following use
case:

Given an value, passed into a function, how do I pull out the lookup?

Ie.
A list of keys (key1, key2, key3)
A list of values (val1,val2,val3)

I want to write a function (or is there something built in?) such that

Callit <- (thekey) {
(magic happens here)
Return value
}

Any ideas?

Thanks a bunch!

==============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer: 

http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================



More information about the R-help mailing list