How do we set constant variables while building R packages? How do we set constant variables while building R packages? r r

How do we set constant variables while building R packages?


One approach would be to use R's options interface. Create a file zzz.r in the R directory (this is the customary name for this file) with the following:

.onLoad <- function(libname, pkgname) {    options(api_path='...', username='name', password='pwd')}

This will set these options when the package is loaded into memory.