0

I have gone through this but it does not answer the question. using Source() in Shiny

I have a land use model in R Script that reads file from one input folder and does a lot of processing and generate outputs. Purpose of shiny is to modify inputs by increasing them by some percentage. My question is, if the model is not packed like a function and as just plain code, would it be able to run and give out required output. Thank you all in advance!

Parag Gupta
  • 31
  • 1
  • 1
  • 5

1 Answers1

0

Your R Script needs to:

  1. Be called (with source()) inside the server of your Shiny App.
  2. Use the input$* for the inputs you need to modify.

Having both, there shouldn't be a problem for it to work. But, yes, converting your R Script to a function then sourcing it before the code for the UI would be much better and understandable. Even for you in the future.

Samuel Calderon
  • 641
  • 3
  • 13