From stvjc at channing.harvard.edu  Tue Aug 21 05:49:22 2007
From: stvjc at channing.harvard.edu (Vincent Carey 525-2265)
Date: Mon, 20 Aug 2007 23:49:22 -0400 (EDT)
Subject: [Rd] aesthetics of do.call
Message-ID: <Pine.GSO.4.58.0708202348040.26109@capecod.bwh.harvard.edu>



library(MASS)
G1 = glm(sp~CW, data=crabs, fam=binomial)
G2 = do.call("glm", list(sp~CW, family=binomial, data=crabs))

G1$call is very nice to look at
G2$call is very voluminous

if we revise do.call to

function (what, args, quote = FALSE, envir = parent.frame())
{
    if (!is.list(args))
        stop("second argument must be a list")
    if (quote) {
        enquote <- function(x) as.call(list(as.name("quote"),
            x))
        args <- lapply(args, enquote)
    }
    ans = .Internal(do.call(what, args, envir))
    ans$call = match.call()
    ans
}

G1 and G2 look a lot more alike

> version
               _
platform       powerpc-apple-darwin8.9.0
arch           powerpc
os             darwin8.9.0
system         powerpc, darwin8.9.0
status         Under development (unstable)
major          2
minor          6.0
year           2007
month          06
day            05
svn rev        41826
language       R
version.string R version 2.6.0 Under development (unstable) (2007-06-05 r41826)


---
Vince Carey, PhD
Assoc. Prof Med (Biostatistics)
Harvard Medical School
Channing Laboratory - ph 6175252265 fa 6177311541
181 Longwood Ave Boston MA 02115 USA
stvjc at channing.harvard.edu



[Rd] aesthetics of do.call
Vincent Carey 525-2265