Thanks for the replies, Jim, David, and Dennis (who replied to me directly)!
To summarize, here's what worked for me:
===
dflist <- list(df1, df2, df3)
lsfun <- function(df) with(df, lsfit(A, B)$coef)
res <- lapply(dflist, lsfun)
do.call(rbind, res)
===
cheers,
-Girish
Girish
On Jan 1, 2010, at 10:34 PM, Girish A.R. wrote:
Hi folks,
Wish y'all a Happy New Year 2010!
I need some help with the following:
Say I have lots of data sets, on which I have to apply a certain
function on
the same set of columns in each of the data set. Let's take, for ex,
the
typical
try this (and happy new year):
DF <- cbind("df1","df2",...,"df100")
result <- lapply(DF, function(.name){
lsfit(get(.name)$A, get(.name)$B)
})
do.call(rbind, result) # put into matrix
On Fri, Jan 1, 2010 at 10:34 PM, Girish A.R. wrote:
>
> Hi folks,
>
> Wish y'all a Happy New Year 2010!
Hi folks,
Wish y'all a Happy New Year 2010!
I need some help with the following:
Say I have lots of data sets, on which I have to apply a certain function on
the same set of columns in each of the data set. Let's take, for ex, the
typical data set is:
df1 <- as.data.frame(cbind(rnorm(10),rnorm
4 matches
Mail list logo