[R] Apply and its friends

Thomas Lumley tlumley at u.washington.edu
Mon Oct 6 15:30:17 CEST 2003


On Mon, 6 Oct 2003, Crispin Miller wrote:

> Hi, Forgive a very basic question... I need to take two lists-of-lists,
> and apply a function to each pair of elements in the lists to return a
> single list... For example
>
> l1 <- list(1:5,6:10,2:15)
> l2 <- list(1:8,4:12,1:19,4:20)
>
> I could easily do an lapply across each of them, but is there a function
> that does a sort-of pairwise-apply across both together?

mapply

	-thomas




More information about the R-help mailing list