1

I currently am using reticulate to import Python modules, and created an environment variable within which I store the modules. This results in something like this:

my.env <- new.env(parent = emptyenv())

.onLoad <- function(libname, pkgname) {
  reticulate::configure_environment(pkgname)
  assign("numpy", reticulate::import("numpy", delay_load = TRUE), my.env)
}

I would like to document this environment variable in order to pass CRAN's inspections, but I'm not quite certain how one would document this. Would anyone have any advice on how to do this with roxygen2? Thanks a lot!

user9006908
  • 113
  • 6
  • 1
    Perhaps see [documenting datasets](https://r-pkgs.org/data.html#documenting-data). An example [here](https://stackoverflow.com/a/67353663/13513328) – Waldi May 19 '21 at 12:08
  • 1
    One approach is to keep it as a hidden environment and only export functions that work with it. For example, the lattice package creates a hidden environment called .latticeEnv in this source file: https://github.com/cran/lattice/blob/master/R/zzz.R – G. Grothendieck May 19 '21 at 12:10

0 Answers0