0

I have 3 files which are needed to my app.

First a general r with functions make some calculations and need to load the ui and server files to run the app.

When I run it on Rstudio it works fine. How is it possible to insert this app to shiny server, meaning that I need first a script and after that run the ui and server files?

Daniel
  • 1,202
  • 2
  • 16
  • 25
Niemik
  • 73
  • 8
  • https://shiny.rstudio.com/tutorial/lesson5/ will help you. – Jake Kaupp Feb 15 '17 at 16:15
  • Its been a long time since I used shiny so can't remember exactly but I think you can just C&P the first file (Rstudio running code) into the first lines of the UI file. Then comes the UI code. Shiny runs the R code, sets up the variables etc then does the UI. Quick to try anyway. – felixmc Feb 15 '17 at 16:16

1 Answers1

0

Use a global.R file or use source(file, local = FALSE) to read R Code from a file.

For more details check the scoping rules.

Karthik Arumugham
  • 1,300
  • 1
  • 11
  • 18