From therneau at mayo.edu  Thu Mar 21 16:34:05 2013
From: therneau at mayo.edu (Terry Therneau)
Date: Thu, 21 Mar 2013 10:34:05 -0500
Subject: [Rd] Depreciating partial matching
In-Reply-To: <30F7521C-5D05-4259-9472-606AF1B36D45@r-project.org>
References: <mailman.37.1363863608.9408.r-devel@r-project.org>
	<514B1072.4000003@mayo.edu> <1363874384.609.7.camel@milan>
	<514B1DC7.3060706@mayo.edu>
	<30F7521C-5D05-4259-9472-606AF1B36D45@r-project.org>
Message-ID: <514B286D.7020902@mayo.edu>



On 03/21/2013 10:00 AM, Simon Urbanek wrote:
>>> I would think that the ability to hit the Tab key to trigger name
>>> >>  completion in your R GUI makes partial matching almost useless. The
>>> >>  avantage of interactive completion in the GUI is that you immediately
>>> >>  see the result of the partial matching. So you get the best of both
>>> >>  worlds: no need to type long variable names in full, but no traps when a
>>> >>  match is not what you would expect.
>>> >>  
>>> >>  Doesn't this suit your use case?
>> >  Good point.  This works well at the command line.  However, not when interacting between emacs and R in the way I do.  For reproducability I use and emacs file that is being corrected and massaged with chunks submitted to R; at the end I have a clean record of how the result was obtained.
>> >  
> If this is really true (that ESS doesn't complete in R files) then this seems more like a bug (or wish?) report for ESS - other editors correctly support code completion in R documents - after all this is a feature of R, so they don't need to re-invent the wheel.
>
> Cheers,
> Simon
If you are running the R process inside ESS then there is matching -- it is R.  Doing 
this, keeping a log file, and then post-hoc cleaning up all the cruft from that file is 
one way to keep documentation.  But since for my analyses the number of models/plots/etc 
that turn out to be detours or dead ends on the way to a solution is larger than the 
worthwhile part (typos alone are lots larger) I prefer to keep the file(s) as their own 
buffers and submit bits of them to an R process either by cut-paste to a separate window 
or ess-submit to an inferior process.  Emacs can't do name completion in that case.  Nor 
could it do so in an Sweave file, unless you were to keep a live R process in hand to 
pre-test chunks as you wrote them.  (One could reasonably argue that when one gets the 
Sweave stage the names should be expanded.)

To summarize: my own interactive mix of emacs/R may be unusual.  For pure interactive 
folks completion does most of the work.  I hadn't tried the newest ESS 
interactive-within-emacs till today, it's slick as well.  The number of people howling 
will be less than my original thought, though not zero.

   Still, this change could cause a lot of grief for saved R scripts.  In our group the 
code + data directory is archived whenever a medical paper is submitted (close to 
500/year), and it is very common to pull one back as is 1-4 years later for further 
exploration.  A very small subset of those are in a legal context where exact 
reproducability is paramount.



[Rd] Depreciating partial matching
Terry Therneau