0

I am creating an app using R's Shiny app package.

I want to load specific RData according to the user's inputs. However, when I run the app it can't seem to be loading the RData properly.

Here follows the code that I am currently using:

dataset <- reactive({

   filename <- paste(input$estado, 
      paste(paste("input_plot_list",
            input$periodo, sep = "_"), "RData", sep = "."), 
      sep = "_")

   load(filename)

})

I hope I was clear, any help is much appreciated!

Cheers.

J_F
  • 9,956
  • 2
  • 31
  • 55
R. Guerra
  • 21
  • 4
  • What is the actual problem here? Was the filename correctly constructed? – Xiongbing Jin Jun 09 '16 at 19:14
  • warmoverflow, the filename is correct, i've already tested it. The problem is that the file just doesn't load.. – R. Guerra Jun 09 '16 at 20:38
  • Did you get any error messages? Or did the `dataset()` reactive function run? Also try full path for the file and see if it works. – Xiongbing Jin Jun 09 '16 at 20:41
  • `dados <- eventReactive(input$go, {get(load(paste(input$estado, paste(paste("input_plot_list", input$periodo, sep = "_"), "RData", sep = "."), sep = "_")))} ) output$plot2 <- renderPlot({ plot(dados()[[2]]) })` – R. Guerra Jun 10 '16 at 16:47
  • That was the solution... Cheer mans – R. Guerra Jun 10 '16 at 16:48

0 Answers0