-project.org
Subject: [R] Question Regarding a nested for loop in R
Hello there,
I'm an R novice and am trying to figure out how to create an external for loop.
My current loop iterates 15 times and stores the resulting values in 3
separate vectors. What I need is to create an outside loop
I'll hope this isn't homework (R-help has a "don't do people's homework
for them" convention), and make a few suggestions.
The inner loop is not needed. For example, you can replace
for (i in 1:15 ) {
Inv1Outcome[i] = if (random[i] <= .25){Inv1Returns[1]}
else if (random[i] > .25 & random[i]
> On Dec 3, 2015, at 2:42 PM, Vermilio, Ryan wrote:
>
> Hello there,
>
> I'm an R novice and am trying to figure out how to create an external for
> loop. My current loop iterates 15 times and stores the resulting values in 3
> separate vectors. What I need is
Hello there,
I'm an R novice and am trying to figure out how to create an external for loop.
My current loop iterates 15 times and stores the resulting values in 3
separate vectors. What I need is to create an outside loop that will run
internal loop 4 times, sum the resulting vectors for
4 matches
Mail list logo