rminiconda icon indicating copy to clipboard operation
rminiconda copied to clipboard

Conda environment installed within R package directory

Open mmuurr opened this issue 4 years ago • 0 comments

Hi, I'm interested in using rminiconda to help with a few Python wrapper functions & packages on which I've been working. I'm curious if you've thought much about a pattern for use for R packages, where the conda 'base' directory is within the R package structure itself. E.g. if my package is mypackage, then the conda environment could be installed at <path_to_R_library>/mypackage/python/conda/envname, or something similar. Then during package startup (i.e. .onLoad()), reticulate could be pointed to a directory housed within package itself like so:

get_miniconda_path("envname", system.file("python", "conda", package = packageName(), mustWork = TRUE))

This way the conda environment associated with an R package is not tied in any way to installed files outside of the R library locations. Perhaps this is a bad idea for reasons I've yet to encounter or think of?

mmuurr avatar Apr 16 '20 04:04 mmuurr