0

I have a server.r file from shiny app. I have also an external file which I want to read it in server.r file.

So I use this:

library(shiny)
require(ggplot2)
source('myfile.R', local = FALSE)

but when I run the app it seems it doesn't read the file. If I open the myfile.R and run it alone after that app is working. Also, I tried to give the full path in source() but again it is not working. Is there any idea what can I do?

The error I receive is: Error : object 'x' not found which is related because it doesn't read the myfile.r

Niemik
  • 73
  • 8
  • What is your evidence that it's not working? Di you get an error? If so, exactly what does it say? How are you running your server.R file? Please try to create a minimal [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) so we might be able to determine what's going on. – MrFlick Feb 15 '17 at 21:48
  • @MrFlick I added the error. Could it be possible to save the rstudio environment and use this in server.r file? – Niemik Feb 15 '17 at 21:59
  • the workaround worked for me is I saved the results as .RData file and I user load() to load the .RData file and I added this line in both ui.r and server.r file – Niemik Feb 15 '17 at 22:16
  • Are you sure myfile.R is in the same directory 'app'? And have you tried local=T? – OmaymaS Feb 16 '17 at 21:15

0 Answers0