2

I wanted to run with crontab (the system daemon used to execute desired tasks at certain times) a shiny script.

I first tried running sh Autorun.sh, being in the file:

R
shiny::runApp(...)

but that didn't work

I also tried writting directly Rscript shiny::runApp(...) but it also doesn't work

Any ideas?

3
  • 2
    Try R -e 'shiny::runApp(...)'. You might need to switch quotes if you're using any inside runApp().
    – Molx
    Commented Jun 1, 2015 at 12:24
  • You tagged it bash and using sh to run, why?
    – Jahid
    Commented Jun 1, 2015 at 14:54
  • @Molx yes!! thank you, that was it! Answer it and I give you the reputation
    – Geiser
    Commented Jun 2, 2015 at 7:34

1 Answer 1

2

To run code using R on shell, you must use the -e option, which stands for expression. The same thing can be done via Rscript.

The correct syntax is then:

R -e 'shiny::runApp(...)'

Care must be taken with the quotes if there are any in the expression being used.

For more information on other command-line options, check An Introduction to R - Appendix B.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.