Hello,
Suppose I would like to develop an entire new R package on GitHub using package reticulate with a lot of Python scripts. Could you please tell what's the best way to do that ? where to put Python scripts, etc. ?
Thank you very much for your help !
One possibility would be to look at the fairly impressive (and still growing strongly) list of reverse dependencies of reticulate and pick a few of those package to study.
@lbocken RStudio/Keras puts everything into inst/python/kerastools https://github.com/rstudio/keras/tree/master/inst/python/kerastools
In general, the strategy is:
inst/python/<module>, where <module> is typically derived from the package name;reticulate::import_from_path(module, path = system.file("python", package = "<package>") to import the module.One such example from the Keras package: https://github.com/rstudio/keras/blob/aaddf0e411f66d48f88f858d1436c1d38e13fb97/R/model-custom.R#L21-L24