[R] Why this statement does not print anything in an if-statement that includes 'q()'?

2009-09-06 Thread Peng Yu
Hi, I run the following script. I don't understand why the second 'length(args)' does not show anything but the first one shows '0'. Is it because the command 'q()' affects anything in the if-statement. However, if I change the second 'length(args)' to 'print(length(args))', the script will

Re: [R] Why this statement does not print anything in an if-statement that includes 'q()'?

2009-09-06 Thread jim holtman
You need to explicitly 'print' the second 'length' function call. Only at the top level of the interactive session is the value of an object printed out if you just reference the object. On Sun, Sep 6, 2009 at 9:13 PM, Peng Yupengyu...@gmail.com wrote: Hi, I run the following script. I don't