search for: do_simulation2

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

Did you mean: do_simulation1
2006 Dec 05
1
dynamic variable creation in lists and data frames
...ested 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 for the other n-thousand simulation...