Skip to content
Prev 324879 / 398502 Next

SPlus script

On 07/06/13 03:19, Scott Raynaud wrote:
If I remember correctly --- haven't used Splus for decades --- this is a 
difference
between Splus and R.

In R the output of a function is returned *invisibly* if that function 
is called
from within another function.  And source() is one such other function.

So if you have a script, say "melvin" with the single line:

     sin(42)

and in R you execute

     source("melvin")

you will see no output.  If in another script, say "clyde" you have the
single line

     print(sin(42))

and in R you execute

     source("clyde")

you will see

     [1] -0.9165215

In Splus, IIRC, the print() call is unnecessary.  I.e. you would get the 
same
result by sourcing "melvin" and "clyde".

Current Splus users may correct me if I am wrong about this.

     cheers,

         Rolf Turner