From p.dalgaard at biostat.ku.dk  Wed Jun 18 10:06:10 2003
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard BSA)
Date: Wed Jun 18 11:06:12 2003
Subject: [Rd] Re: [R] suggestion for make.names
In-Reply-To: <Pine.LNX.4.44.0306180655380.27947-100000@gannet.stats>
References: <Pine.LNX.4.44.0306180655380.27947-100000@gannet.stats>
Message-ID: <x28yrz925z.fsf@biostat.ku.dk>

Prof Brian Ripley <ripley@stats.ox.ac.uk> writes:

> > Another way to fix the first problem, by the way, would be to allow
> > quoting in formulas, e.g. lm("if" ~ then, ...).  Currently, when you
> > do this it gives an error.  This could eliminate the need for
> > make.names in many cases, by being able to quote names like 
> > "New Jersey" or "log(x)".
> 
> Yes, we know and it is planned to allow that.  However, R is a volunteer 
> project and that looks far from trivial and rather low priority.  Now if 
> you have a patch for that we would be pleased to see it.

It is not only non-trivial, but there is also a risk of running into
logical inconsistencies in some applications of model formulas. E.g.
in nls() and friends, the RHS is an arbitrary R expression and it
might involve true character strings -- think

y~lsoda(start, "Time since inj.", "myfun", parms=c(a=1,b=2),
        dllname="myfun.dll") 

where "Time since inj." could be a variable name, but the other two
are literals.

I'm rather tempted to suggest an extension to R's syntax involving a
"symbol quote" (the backtick, `like this`, would be available).
Haven't really thought it through though.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907


[Rd] Re: [R] suggestion for make.names
Peter Dalgaard BSA