Skip to content

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

3 messages · Patrick Connolly, Brian Ripley, detlef.steuer@unibw-hamburg.de

#
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
#
On Tue, 27 Mar 2001, Patrick Connolly wrote:

            
Using output text connections would be more elegant (implemented in R only
at present, and only at 1.2.0 so post V&R).
www.cvshome.org, I think currently (was www.cyclic.com).  It's not to do
with R/S but a way to keep on a server files and records of all changes.
For example the R source code is kept in a CVS archive, as is all the V&R
material (tex files as well as software).

I guess the R-recommended way of working is to use packages, kept in source
form, and to archive the package source.
#
On 27-Mar-01 Prof Brian D Ripley wrote:
Just an addition:

To start using cvs try
http://cvsbook.red-bean.com/cvsbook.html

Gives a very readable introduction.

detlef 


Detlef Steuer ** Universität der Bw ** 22043 Hamburg
steuer at unibw-hamburg.de Tel: (0049) (0)40/6541-2819

There is more to life than increasing its speed.  - Mahatma Gandhi

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._