[R] authorized characters and symbols

Prof Brian Ripley ripley at stats.ox.ac.uk
Mon Jun 2 12:36:10 CEST 2003


On Mon, 2 Jun 2003 vincent.stoliaroff at socgen.com wrote:

> Obviously I cannot use the underscore "_ " character to name an object 
> in R

Actually, you can but it is more trouble than it is worth as you will 
always have to quote the name, and often explicitly get it:

> "my_pi" <- pi
> get("my_pi")
[1] 3.141593

> Is there a special reason for that ?

Yes, it is allowed for assignment, but not for much longer.  Once
it is removed for assignment (1.8.0) it will be allowed as part of a name
after a decent interval.

> I want to use it to rename a function
> maybe the problem is due to the nature of the object I work on
> 
> thanks for any comments on that very little and not very bothering trouble

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list