I have a list with multiple data frames. Each data frame contains three columns (ColumnOne, ColumnTwo and ColumnThree).
list <- list(df1, df2, df3)
I am using lapply to run a regression on each data frame.
regression <- lapply(list, function (x)
lm(x$ColumnOne ~ x$ColumnTwo + x$ColumnThree))
When I display the output of regression, everything seems correct.
Now, I want to use broom::tidy to collect the regression outputs for each data frame in a table.
library(broom)
df <- lapply(regression, function(x)
tidy(regression$x))
df
However, when I display df, it only shows empty (0x0) data frames.
Would appreciate any help!