Hi:

Is this what you need?

l_one <- data.frame(key = c(2, 1, 2))
l_two <- data.frame(ndx = 1:4, descr = c('this', 'that', 'other', 'finis'))
merge(l_one, l_two, by.x = 'key', by.y = 'ndx')
  key descr
1   1  this
2   2  that
3   2  that

HTH,
Dennis

On Wed, Oct 27, 2010 at 10:53 AM, Jim Burke <j.bu...@earthlink.net> wrote:

> My two lists look like below
> Need an R code example that
> combines the two.
>
> l_one
> "key"
> 2
> 1
> 2
>
>
> l_two
> "ndx", "descr"
> 1, "this"
> 2, "that"
> 3, "other"
> 4, "finis"
>
> My goal is a new list that looks
> like below.
> ndx descr
> 2   that
> 1   this
> 2   that
>
> Thanks,
> Jim
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to