I am using two for loops to run some simulations. One that increases N by 50 each iteration and other within that runs the simulation a 1000 times. However with what I have currently the result dataframe doesn't save the outputs for each different sequence value of N and instead only shows the final output values for the last value of N in the sequence, in this case the values for N=500.
So I was wondering is there a way to make a dataframe that keeps all the output values for all the different values of N?
for (N in seq(100,500,50)) {
P <- rep(NA,1000)
for (i in 1:1000) {
P[i] <- function()
}
result <- data.frame(P) # this is simplified
}