search for: do_simulation1

Displaying 1 result from an estimated 1 matches for "do_simulation1".

Did you mean: do_simulation2
2006 Dec 05
1
dynamic variable creation in lists and data frames
...running simulations and am interested in two parameters, ESM and ESMM (the similarity of these names is important for my question). I do simulations to generate ESMM, then plug these values into a second simulation function to get ESM: x <- list() for (i in 1:nsimulations) { x$ESMM[i] <- do_simulation1() x$ESM[i] <- do_simulation2(x$ESMM[i]) } and I return everything as a dataframe, x <- as.data.frame(x) When I do this, I find that x$ESMM is overwritten by x$ESM for the first simulation. However, x$ESM is nonetheless correctly generated using x$ESMM. Thus, x$ESM[1] = x$ESMM[1], but fo...