Skip to content
Prev 369773 / 398503 Next

[FORGED] IF LOOOP

I'm not sure that the source of this code should be considered a trusted foundation for learning R. You should not be using for-loops to modify vectors in this manner.
That's probably not needed.
I suspect you meant to use:

?'next'   # since `break` completely terminates a for-loop.


The ?'help' page has all the "control structures": `for`, `repeat`, `while` and associated boundaries and terminators

Both `break` and `next` are reserved words (names of functions, control tokens), so using the `?` operator requires quoting.

Also that for-next loop would do _nothing_ to the value of r. Printing would not modify the value of `r`.

You should read:

?Reserved

?'for'  # since `for` is also reserved

?print
After following Rolf's advice ... Try:

r[ all.equal(r, 0.990956) ]
Further note to matthias:
All caps in Subject is considered poor form, as is posting in HTML.