Re: [R] not understanding a do.call

From: Brahm, David <David.Brahm_at_geodecapital.com>
Date: Wed 18 Oct 2006 - 18:12:40 GMT


Mark Leeds <Mark.Leeds@morganstanley.com> wrote:
> could someone explain the difference between
> do.call("cbind",list(a,b,c,d)) and cbind(a,b,c,d).

do.call("cbind", list(a=a, b=b, c=c, d=d)) is indeed the same as cbind(a, b, c, d). But suppose you wanted a function to cbind any number of vectors in reverse order:

myfun <- function(...) do.call("cbind", rev(list(...)))


R-help@stat.math.ethz.ch 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 Thu Oct 19 09:49:23 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 19 Oct 2006 - 00:30:11 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.