[Rd] prefix 'R_' when calling external code

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Jul 5 10:19:50 CEST 2006

On Sat, 1 Jul 2006, Benjamin Tyner wrote:

> I noticed that in
> https://svn.r-project.org/R/trunk/src/library/stats/R/loess.R
> that we are now calling R_loess_raw, R_lowesw, R_lowesp, etc. I'm
> interested to know what is the benefit/reason for the 'R_', as I am
> unfamiliar with this prefix and do not see it mentioned in 'Writing R
> Extensions.'

It is used when mapping external entry points to R symbols in that 
package: the latter must not clash with other R objects in the namespace, 
and this is why the prefix is added (in the NAMESPACE file, at

  # Refer to all C/Fortran routines by their name prefixed by R_
useDynLib(stats, .registration = TRUE, .fixes = "R_")


You say 'now': 'we' (R-core) never had loess_raw as an R symbol, rather 
"loess_raw" as a character string.

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-devel mailing list