I am currently working in R and I am trying to populate a matrix with a some for loops. However, I keep getting the "number of items to replace is not a multiple of replacement length" error. The way I set my matrix() is that I specified nrow (because I am sure of the size) and I leave the ncol blank.
How can I create a matrix that dynamically allocate the dimensions?
Any recommendations? Thank you.