On 01/24/2010 04:37 AM, David Lubbers wrote:

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?

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

--
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://tr.im/KfKn : Rcpp 0.7.2
|- http://tr.im/JOlc : External pointers with Rcpp
`- http://tr.im/JFqa : R Journal, Volume 1/2, December 2009

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to