I have two data frames df1 and df2. both of them have 240 obs. of 204 variables. I have checked and there are no missing or NA values in those files. However when I regress by this formula:
library(broom)
fit4 <- lapply(names(df1), function(x){
dd = tidy(lm(df1[[x]] ~ df2[[x]]))
data.frame(name = x, dd)})
It shows the following error messages:
Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : NA/NaN/Inf in 'y'