diff options
Diffstat (limited to 'R')
-rw-r--r-- | R/zzz.R | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -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()) } |