From ripley at stats.ox.ac.uk  Wed Jul  5 10:19:50 2006
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Wed, 5 Jul 2006 09:19:50 +0100 (BST)
Subject: [Rd] prefix 'R_' when calling external code
In-Reply-To: <44A73BC8.5080901@stat.purdue.edu>
References: <44A73BC8.5080901@stat.purdue.edu>
Message-ID: <Pine.LNX.4.64.0607050914150.11987@gannet.stats.ox.ac.uk>

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



[Rd] prefix 'R_' when calling external code
Prof Brian Ripley