diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2021-11-18 23:03:16 +0100 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2021-11-18 23:03:16 +0100 |
commit | ae755fbb06c3dda0740e9bb9323fbdfe3f2788a4 (patch) | |
tree | 83775c62311c2b9dde8d5e9b4283cfd03b2d2b60 /R/zzz.R | |
parent | 898d598bcbb022ac767e0105e868798130f2c74c (diff) |
Use reticulate instead of PythonInR, alanwood has moved
Because the pesticide compendium at alanwood.net has moved to bcpc.org,
we need to depend on a development branch of webchem at the moment.
Diffstat (limited to 'R/zzz.R')
-rw-r--r-- | R/zzz.R | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -0,0 +1,13 @@ +.onLoad = function(libname, pkgname) { + rdkit_available <- FALSE + if(requireNamespace("reticulate", quietly = TRUE)) { + rdkit_module <- try(reticulate::import("rdkit")) + if (!inherits(rdkit_module, "try-error")) { + rdkit_available <- TRUE + } + } + assign('rdkit_available', rdkit_available, envir = topenv()) + if (rdkit_available) { + assign('rdkit_module', rdkit_module, envir = topenv()) + } +} |