aboutsummaryrefslogtreecommitdiff
path: root/R/zzz.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2021-11-18 23:03:16 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2021-11-18 23:03:16 +0100
commitae755fbb06c3dda0740e9bb9323fbdfe3f2788a4 (patch)
tree83775c62311c2b9dde8d5e9b4283cfd03b2d2b60 /R/zzz.R
parent898d598bcbb022ac767e0105e868798130f2c74c (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.R13
1 files changed, 13 insertions, 0 deletions
diff --git a/R/zzz.R b/R/zzz.R
new file mode 100644
index 0000000..19ca10d
--- /dev/null
+++ b/R/zzz.R
@@ -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())
+ }
+}

Contact - Imprint