I am trying to populate a named list with OLS results in R. I tried
li = list() for (i in 1:10) li[["RunOne"]][i] = lm(y~x)
Here RunOne is a random name that indicates a suitable run, y and x are some predefined vectors. It breaks and gives me an error
Warning message: In l[["RunOne"]][1] = lm(y ~ x) : number of items to replace is not a multiple of replacement length
Although I understand the error, I donβt know how to fix it.
source share