Skip to content

wrong if-else syntax

2 messages · mauede at alice.it, Duncan Murdoch

#
On 04/05/2009 5:08 AM, mauede at alice.it wrote:
I just tried the full block above, and it was fine.
Notice the prompt here is >, not +.  The problem occurred earlier:  R 
thinks this is a new statement, not part of the "if (DonohoAplhaON) {" 
block as you intended.
This finishes the statement, so the else doesn't make sense.
The spacing here doesn't match what you showed above.  Are you sure 
you're pasting the right file?

You'll get better error handling using source() than cut and paste. 
source() will stop at the first error; cut and paste just keeps going.

Duncan Murdoch