[R] Generate a vector of values, given a vector of keys and a table?

David Wolfskill r at catwhisker.org
Fri Sep 11 13:23:23 CEST 2015


On Thu, Sep 10, 2015 at 10:30:50PM -0700, Bert Gunter wrote:
> ?match
> 
> as in:
> 
> > y <- lk_up[match(x,lk_up[,"key"]),"val"]
> > y
>  [1] "10000" "10000" "10000" "10000" "15000" "15000" "20000"
>  [8] "20000" "20000" "20000"
> ...

Aye -- thank you very much!

Peace,
david
-- 
David H. Wolfskill				r at catwhisker.org
Those who would murder in the name of God or prophet are blasphemous cowards.

See http://www.catwhisker.org/~david/publickey.gpg for my public key.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 949 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20150911/9ad0700f/attachment.bin>


More information about the R-help mailing list