aboutsummaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
Diffstat (limited to 'R')
-rw-r--r--R/zzz.R12
1 files changed, 4 insertions, 8 deletions
diff --git a/R/zzz.R b/R/zzz.R
index 19ca10d..5503a4a 100644
--- a/R/zzz.R
+++ b/R/zzz.R
@@ -1,13 +1,9 @@
.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
- }
+ rdkit_module <- try(reticulate::import("rdkit"), silent = TRUE)
+ 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())
- }
+ assign('rdkit_module', rdkit_module, envir = topenv())
}

Contact - Imprint