aboutsummaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2024-04-05 14:51:17 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2024-04-05 14:51:17 +0200
commit306c86a1821de2f54a15f44637eb481e9cc0c292 (patch)
tree43f9283a8d0137841f7140feddc7ca505e98ad85 /R
parente92727f871c2c8217251e34e52438f18c5f013bb (diff)
Delay loading of the rdkit module
According to the recommendation found here: https://rstudio.github.io/reticulate/articles/package.html#delay-loading-python-modules
Diffstat (limited to 'R')
-rw-r--r--R/zzz.R4
1 files changed, 3 insertions, 1 deletions
diff --git a/R/zzz.R b/R/zzz.R
index 5503a4a..248f830 100644
--- a/R/zzz.R
+++ b/R/zzz.R
@@ -1,6 +1,8 @@
.onLoad = function(libname, pkgname) {
rdkit_available <- FALSE
- rdkit_module <- try(reticulate::import("rdkit"), silent = TRUE)
+ rdkit_module <- try(
+ reticulate::import("rdkit", delay_load = TRUE),
+ silent = TRUE)
if (!inherits(rdkit_module, "try-error")) {
rdkit_available <- TRUE
}

Contact - Imprint