0

I'm having trouble calling the source() function in shiny.

The ideia is that the user, based on a text input (in this case, input$textinput), see some details on the subject he typed, like maps and datatables of it.

here's the code of how it works inside an observeEvent

observeEvent(input$search, {
    source("maps.R", local = TRUE)
    source("graphs.R", local = TRUE)}

At first i realized that i needed to set the argument local = true inside source(). It then recognized the input$textinput, but still wouldn't load the maps and the graphs as it was supposed to.

I then realized that when i call the source() the objects didn't load into the global enviroment.

Any ideas of what i'm doing wrong?

Lucca Ramalho
  • 573
  • 1
  • 6
  • 16
  • When asking for help, you should include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. What's in the files you are sourcing? – MrFlick May 08 '18 at 15:17
  • Are you trying to load new data based on the search inputs? Or new function definitions? – Alex Skorokhod May 09 '18 at 04:22

0 Answers0