Skip to content

header files for R packages

2 messages · David Lubbers, Romain Francois

#
I have 6 or 7 nice constants (for example 1852 meters per nautical mile)
I would like to have available to 4 or 5 functions in an R package.   In
C this would just be a header .h file and I would just "include"  I am
stuck trying to figure out how to create something like a C header file
for an R package.  Any ideas?
#
On 01/24/2010 04:37 AM, David Lubbers wrote:
Hi,

If your package has a namespace, it is easy. If not, add one.

Just create the "constants" in one of your R files within the package. 
that's it. If you don't export the constant, that is all you really need.

Otherwise, you can lock the binding using lockBinding, but this is not 
full proof as one can still remove the variable and recreate it ... it 
just makes it harder to modify, but not impossible

Romain