0

I've installed the below R app and managed to get it up and running absolutely fine.

https://github.com/kadekillary/ngram-shiny-app

I want to create a command file which will execute the app and have tried several solutions but no luck so far.

Any thoughts?

Thanks in advance

elliot
  • 35
  • 1
  • 5
  • Have you consider putting into a docker container? https://hub.docker.com/r/rocker/shiny/ – D Pinto May 23 '18 at 18:55
  • What exactly did you try and how exactly did they not work? – MrFlick May 23 '18 at 19:22
  • I tried navigating to the project folder, running r, opening the shiny library then running the app - a process which works fine if done manually - not sure why this doesn't work when I package those commands in sequence inside a command file. – elliot May 23 '18 at 19:40

1 Answers1

2

You can run R in the working directory the following way:

 R < app.R  --no-save

It should open something like "Listening on http://127.0.0.1:6978"

Open this address in your browser.

Andrii
  • 2,843
  • 27
  • 33
  • Thanks! This achieves what I want. Is there an easy way to get it to auto open the URL with chrome and close terminal at the same time? Thanks so much – elliot May 23 '18 at 21:41
  • You can use "crontab -e" to edit time for autorunning – Andrii May 24 '18 at 04:46