Re: [R] list matching

From: Henrique Dallazuanna <wwwhsd_at_gmail.com>
Date: Mon, 14 Jun 2010 09:39:59 -0300

Try this:

cbind(mynames[rep(seq(nrow(mynames)), sapply(lst, length)),], unlist(lst))

On Mon, Jun 14, 2010 at 9:06 AM, Yuan Jian <jayuan2008_at_yahoo.com> wrote:

> Hello,
>
> I could not find a clear solution for the follow question. please allow me
> to ask. thanks
>
> mynames=cbind(c('a','b'),c(11,22))
> lst=list(a=c(1,2), b=5)
>
> now I try to combine mynames and lst:
> a 1 11
> a 2 11
> b 5 22
>
> thanks
> jian
>
>
>
>
> [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help_at_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.
>
>

-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

	[[alternative HTML version deleted]]


______________________________________________ R-help_at_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.

Received on Mon 14 Jun 2010 - 12:43:44 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 14 Jun 2010 - 12:50:29 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive