Skip to content
Back to formatted view

Raw Message

Message-ID: <51B10B9A.5060406@xtra.co.nz>
Date: 2013-06-06T22:22:18Z
From: Rolf Turner
Subject: SPlus script
In-Reply-To: <1370531969.88020.YahooMailNeo@web142705.mail.bf1.yahoo.com>

On 07/06/13 03:19, Scott Raynaud wrote:
> I actually had tried placing arguments in the call but it didn't work.   However, I did
> not think about writing it to a variable and printing.  That seems to have done the
> trick.  Funny, I don't remember having to do that before, but that's not surprising.
>

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