Commit 37ade02c authored by phit0's avatar phit0
Browse files

[base] ask user to install rhdf5

.onLoad checks if rhdf5 is install and installs when allowed by the user.
parent 3d1f063a
Pipeline #7450 passed with stage
in 4 minutes and 41 seconds
......@@ -20,7 +20,9 @@ Suggests:
testthat,
knitr,
devtools,
ggplot2
ggplot2,
BiocManager,
rhdf5
Imports:
purrr,
xml2,
......@@ -39,8 +41,7 @@ Imports:
reticulate,
config,
sticky,
foreach,
rhdf5
foreach
RoxygenNote: 7.1.2
VignetteBuilder: knitr
Depends:
......
......@@ -35,11 +35,43 @@ dsa <- NULL
vtk <<- reticulate::import("vtk", delay_load = TRUE)
dsa <<- reticulate::import("vtk.numpy_interface.dataset_adapter",
delay_load = TRUE)
packageStartupMessage({
if (!requireNamespace("rhdf5", character.only = TRUE)) {
if (!requireNamespace("BiocManager", character.only = TRUE)) {
userin <- readline(
"The packages rhdf5 and BiocManager are required for r2ogs6
\n but are not installed.
\n Do you want to install it now? (y/n)")
if (tolower(userin) == "y") {
tryCatch({install.packages("BiocManager")},
error = function(e) {
cat("\nPackage BiocManager could not be installed")
print(e)
}
)
} else {
cat("\nBiocManager installation was skipped")
}
} else {
userin <- readline(
"The package rhdf5 required for r2ogs6 is not installed.
\n Do you want to install it now? (y/n)")
}
if (tolower(userin) == "y") {
tryCatch({BiocManager::install("rhdf5")},
error = function(e) {
cat("\nPackage rhdf5 could not be installed")
print(e)
})
} else {
cat("\nrhdf5 installation was skipped")
}
}
})
return(invisible())
}
.onAttach <- function(libname, pkgname){
packageStartupMessage(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment