Skip to content
Prev 10392 / 398513 Next

Use of substitute -- was More powerful than objects() or ls()

According to Prof Brian D Ripley:
|>
|> On Mon, 26 Mar 2001, Patrick Connolly wrote:
|> 
.....

|> > I think it would be simple enough if I could get something in R to
|> > work the way substitute() does in Splus.  The thinking seems to be
|> > very different between the two dialects.  Maybe if I tinker a bit
|> > longer, I'll get the connexion between them.
|> 
|> They are almost the same. (See V&R's `S Programming' for a detailed
|> comparison.)   There is a difference when using function arguments:
|> S uses the initial values, R the current ones, so in R one often needs to
|> substitute early or take care to work on copies.

Indeed, V&R explains it, so that's useful.  Thanks again, Brian.  But
as Thomas Lumley anticipated, it is not straighforward to make use of
comment with it.  Writing to and sourcing from a temporary text file
is not very elegant, but also not very complicated,


|> Ah, I think most of us keep our functions in files not in objects, even in
|> S-PLUS. I even keep my datasets in files (or databases).  I know John
|> Chambers advocates an `S object is master' view in the Green book, but I
|> don't find it very practical given current tools.  

It is very practical with my Splus function (even though I could write
it rather a lot better now).  It's useful on those occasions when I
attach to a directory where I did similar work some years ago and look
through the lists, functions, matrices, dataframes and the like that I
used there. I can quickly decide what I can use in the present
directory.  Even so, there is good reason to have a file of the code
the function uses, and now I know how to use substitute, that's easy
to automate.


|> A CVS archive of R/S code is a very useful way of version control.

Sounds interesting.  Where will I find information about CVS archives?
V&R don't have any mention in the index/es.

best
Message-ID: <200103270408.f2R48G129179@biomat1.marc.hort.cri.nz>
In-Reply-To: <Pine.GSO.4.31.0103260702530.28858-100000@auk.stats> from "Prof Brian D Ripley" at Mar 26, 2001 07:08:49 AM