...Hi, first post so apologies if this is not the best location. I'm new to Shiny and relatively new to R, but I've experimenting with creating a multi-tabbed Shiny App, as a means of keeping various projects under a master pod for ease of sorting. Now ideally I just want a simple index file reference all the modules. I've been able to create a simple app that works as required, but everything has to be coded in full, ideally I'd like to be able to utilise loops to write the necessary UI and Server elements when the app is launched.
It works fine if I write all the relevant lines out in the app.R file, but that seems inflexible. Instead I've written a simple function in global.R that checks the index.RData for the list of modules, and has strings which specify where the source files are.
The particular item I'm really struggling with is the source commands which reference the ui and server files, i.e.:
source(file.path("folder", "file.R"), local = TRUE)$value
Within the UI section of app.R, if there are multiple folders within the navbarMenu, a comma is required at the end of the statement which I understand. However, what I'm struggling with is parsing my code from the function works fine if there's only a single source statement, but fails if multiples exist.
The issue is the trailing comma, but I can't get that to resolve. I've tried instead building a single string to parse into the eval statement but to no avail. If anyone can think of anything I can try to be able to submit multiple source statements dynamically within the UI that would be a massive help
The error I get as things stand is:
Error in parse(text = as.character(AddItem("SubFolder", ScriptModules, :
:1:65: unexpected ','
1: source(file.path("ScriptMODs","Index_ui.R"), local = TRUE)$value,