3

I am planing on getting stock data from yahoo finance at the end of each business day (using quantmod). this data is then used to update my shiny app. Now I have to do this manually, I update my csv file which I than upload to shinyapps.io each day. This csv is used for the app.

Is there a way to fully automate this in shiny/shinyapps.io ?

Now I know that this has been asked here before, at least in a similar setting. However there has not been a helpful answer provided to setting up a cron job in shiny and shinyapps io. Packages like littler an Rscript have been mentioned, but they seem to be outdated since I can not even get them for my latest R version.

Any hint on how to do this would be much appreciated

Sue Tizzi
  • 33
  • 3
  • Why do you want to upload a csv-file with yahoo finance data in the first place? Why are you not using the 'getSymbols' function from the 'quantmod' package in your shiny app to ensure that it is always uptodate? – hvollmeier Nov 19 '16 at 16:00
  • So how do I use the getSymbols function on a scheduled basis in the shiny app then? It is the exact same problem! – Sue Tizzi Nov 19 '16 at 17:17
  • If you use 'getSymbols' you get the latest stock data from Yahoo! I don't understand why you want to create a csv-file and schedule an upload of the data then read the data when you can get the same data directly with 'getSymbols' into your app. – hvollmeier Nov 19 '16 at 19:36
  • I of course thought about this, but I am afraid that this would break/freeze the shiny app. Here is why: There will be at least 100-400 stocks in the app. I only need the market cap of the last day from yahoo. I thought about doing this with yahooQF/getQuote. However the problem is the app has a slider with a multplication factor on the market cap. That would mean each time the user touches the slider all those 100 quotes will be fetched again, and again and again. I suspect that would take too much time and memory, leading the app to break. – Sue Tizzi Nov 20 '16 at 06:35

1 Answers1

0

You can look for Rstudio's new product: R Studio Connect, it provides scheduling feature.

https://www.rstudio.com/products/connect/

radhikesh93
  • 870
  • 9
  • 25