I'm trying to use Shiny as a GUI for running an R code, so that people who don't usually use R will be able to operate. Essentially this script is just uploading two csv tables, choosing parameters (eg defining something like x=30, y=10) and letting the R script run normally. The output is just plots and two tables.
(note: I understand that in order for shiny to present the plots I need to use the appropriate commands in ui and server, but that is a more advanced thing I'd like to do in the future)
The code is already written in a "regular" R script. While running parts of it using "observe" and other reactivities, the global environment stays empty and it seems to me there's an easier way to perform this task than the way I'm trying to do it.
"... it should not be included in an app that is accessible to other people , as letting others run arbitrary R code can open you up to security attacks."
It's not that simple to just put a Shiny app on top of an R script as you'll have to build reactive environments over certain parts of the code.
If you like it really simple and don't mind the users having to start the script themselves (source button), you can use the svDialogs package for example to prompt input
library(svDialogs)
dlgMessage("Please select a CSV file")
inputFile = dlg_open(title = "Select one CSV file")$res
value=dlg_input(message = "Enter a value")$res
This way the user will get some input boxes when the script runs. It's up to you though to write code to check the validity of the input and prompt again if something goes wrong ...