From 295d0814a7e9f59d2ff2cc2fc0007bab10a7686b Mon Sep 17 00:00:00 2001 From: Schultheis Date: Mon, 25 Jun 2018 15:43:59 +0200 Subject: [PATCH] 'external_data' folder as optional second source of data files --- wilson-basic/app.R | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/wilson-basic/app.R b/wilson-basic/app.R index ab15020..4006919 100755 --- a/wilson-basic/app.R +++ b/wilson-basic/app.R @@ -498,6 +498,19 @@ server <- function(session, input, output) { # Use all .se and .clarion files specified in data/ load <- sapply(list.files(path = "data/", pattern = "\\.se|\\.clarion"), function(x){ paste0("data/", x)}) + # check for additional data + if (dir.exists("external_data/")) { + # use all .se and .clarion files specified in external_data/ + external <- sapply(list.files(path = "external_data/", pattern = "\\.se|\\.clarion"), function(x){ paste0("external_data/", x)}) + + if (length(external) > 0) { + # merge file lists + load <- c(load, external) + # sort by name + load <- load[order(names(load))] + } + } + output$fileLoader <- renderUI({ shiny::req(input$data_origin)