Ross Ihaka
1997-Apr-29 23:13 UTC
S Compatibility (Was: Re: R-beta: 'all.names' function -- failing as.list( _function_ ))
Peter Dalgaard writes:> Ross Ihaka <ihaka at stat.auckland.ac.nz> writes:> > Many of the incompatibilities result from us not being familiar with > > some of the inner mysteries of S - these are generally pretty easy to > > fix. Some incompatibilities however result from the fact that R > > started life as a kind of Lisp interpreter. These can be quite a bit > > harder to fix.> Also (this is an absolutely uninformative and uninformed remark, I > know) I hope you/we will think these matters over very carefully, > before possibly throwing a baby out with the bathing water. Some of > the mysteries of S are probably better categorized as design bugs, and > in contrast Lisp-dialects have been subjected to a long history of > analysis by computer scientists in all the critical issues of memory > handling, scoping rules, optimizability, compilability, etc.> A little divergence between the two languages is not really critical, > we already have it in the scoping rules, and as long as the internal > logic is OK, I don't think that the porting issues are all that bad.The primary reason for having S compatibility is so that we "buy" (some might say "steal") applications [and I must say I am both surprised and gratified at the number which seem to be appearing - thanks to everyone for this!]. For the most part, the "price" of compatibility is small and in a number of cases moving from our own (sometimes confused) model to the S one has been a big win. Some things we almost certainly won't be changing. Scoping is one of these (although I have to confess that I have made the pitch to Robert that we should drop our scoping in favour of the S version - he sensibly said "no"). It's very important that there be a "free" alternative to to S-PLUS (I have just deleted a long tirade about this - you're probably all converts anyway). ``Giving in'' on a few points is a small price to pay for enough applications to ensure R's success. Ross =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-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 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thomas Lumley
1997-Apr-29 23:28 UTC
S Compatibility (Was: Re: R-beta: 'all.names' function -- failing as.list( _function_ ))
On Wed, 30 Apr 1997, Ross Ihaka wrote:> > Some things we almost certainly won't be changing. Scoping is one of > these (although I have to confess that I have made the pitch to Robert > that we should drop our scoping in favour of the S version - he > sensibly said "no").Quite right too. My favorite example is a function that I and several of my fellow students have at various times tried to write in S. jack.lm<-function(lm.obj){ ii<-as.matrix(1:length(lm.obj$residuals)) var(t(apply(ii,1,function(i) update(lm.obj,subset=-i)$coef))) } or similar things for bootstrap, weighted bootstrap, glms and so on. In every case people have spent hours staring at this code and wondering why it claims to be unable to find lm.obj. My view on the scoping rules of R is that they aren't an incompatibility since most people I have talked to think that S scopes this way. Thomas Lumley ------------------------------------------------------+------ Biostatistics : "Never attribute to malice what : Uni of Washington : can be adequately explained by : Box 357232 : incompetence" - Hanlon's Razor : Seattle WA 98195-7232 : : ------------------------------------------------------------ =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-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 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=