Like @Roland says, get your objects into a list first, then everything will be easy. Assuming you have ~20,000 objects in your workspace (!!!) all called e.g. b1
, b2
,...b20000
, you can stick them in a list, extract the summary stats and return a data.frame
like this:
# Stick objects in a list
x <- mget( ls( pattern = "^b[0-9]+$" ) )
# Extract summary statistics
out <- lapply( x , function(x) c(x$r.squared, x$adj.r.squared, x$fstatistic) )
# Turn into a data.frame
as.data.frame( out )