From 40b01e88e77e2a95232fe11d868437f865d58e2d Mon Sep 17 00:00:00 2001 From: Ger Inberg Date: Tue, 30 May 2023 11:03:25 +0200 Subject: [PATCH] #40 check environment variable --- R/EunomiaData.R | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/R/EunomiaData.R b/R/EunomiaData.R index b8c51f7..40699e7 100644 --- a/R/EunomiaData.R +++ b/R/EunomiaData.R @@ -54,8 +54,11 @@ downloadEunomiaData <- function(datasetName, )) invisible() } else { - # downloads the file from github - baseUrl <- "https://raw.githubusercontent.com/OHDSI/EunomiaDatasets/main/datasets" + # downloads the file from github or user specified location + baseUrl <- Sys.getenv("EUNOMIA_DATASETS_URL") + if (baseUrl == "") { + baseUrl <- "https://raw.githubusercontent.com/OHDSI/EunomiaDatasets/main/datasets" + } result <- utils::download.file( url = paste(baseUrl, datasetName, zipName, sep = "/"), destfile = file.path(