s-news
[Top] [All Lists]

Sum: Function to summarize lm objects

To: "'s-news@lists.biostat.wustl.edu'" <s-news@lists.biostat.wustl.edu>
Subject: Sum: Function to summarize lm objects
From: "Yang, Richard" <dyang@NRCan.gc.ca>
Date: Thu, 29 Mar 2001 12:32:39 -0500
Hi Spluser;

Many thanks to Sam Buttrey, James Holtman, and Brad Biggerstaff for their
quick responses. As Sam Buttrey points out, the key here is get() function,
which takes a name and returns the object with that name. The function

Result <- function(n) {
         lmfile <- paste("lmrun",1:n, sep="")
         sink("Sum.lm", append = T)
         for (i in 1:n) {
             print(summary(get(lmfile[i])))
         }
        sink()
}

summarizes all objects named lmrun1 to n in the file Sum.lm.

Thanks,

Richard



<Prev in Thread] Current Thread [Next in Thread>
  • Sum: Function to summarize lm objects, Yang, Richard <=