hafen / rminiconda

Install and maintain isolated miniconda Python installations from R
Apache License 2.0
65 stars 3 forks source link

Conda environment installed within R package directory #12

Open mmuurr opened 4 years ago

mmuurr commented 4 years ago

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?