diff --git a/R/zzz.R b/R/zzz.R index 4354388..372885d 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -3,11 +3,15 @@ .onLoad <- function(libname, pkgname) { fls <- dir(system.file("extdata", package = pkgname), full.names = TRUE, pattern = "metadata") - sapply(fls, - function(fl) { - titles <- read.csv(fl, stringsAsFactors = FALSE)$Title - ExperimentHub::createHubAccessors(pkgname, titles) - }) + if (curl::has_internet()) { + sapply(fls, + function(fl) { + titles <- read.csv(fl, stringsAsFactors = FALSE)$Title + ExperimentHub::createHubAccessors(pkgname, titles) + }) + } else { + warning("Not internet connectivity. Unable to create Hub accessors.") + } } .onAttach <- function(libname, pkgname) {