[Rd] Re: [R] suggestion for make.names

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Wed Jun 18 10:06:10 MEST 2003


Prof Brian Ripley <ripley at 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 at biostat.ku.dk)             FAX: (+45) 35327907



More information about the R-devel mailing list