2

My Shiny app works fine locally, but when I deploy it on shinyapps.io, I face the following error:

Error: could not find function "shell"

However, shell is an R built-in function (base package). So I don't really see what causes the error here and how to fix it?

Please see follow-up question here

Community
  • 1
  • 1
Antoine
  • 1,649
  • 4
  • 23
  • 50

1 Answers1

6

You have to remember that shell is a windows specific function. So, what probably happens is that you develop your app under windows, where shell works. However, when deploying the app probably runs under linux, where shell is not available. If you want to use system commands, I would use system in stead of shell.

Paul Hiemstra
  • 59,984
  • 12
  • 142
  • 149
  • right on. So if I use `system` instead of `shell` that should work on Linux? – Antoine Apr 04 '16 at 15:11
  • when I replace `shell` by `system` it does not throw the error anymore but it raises a warning `Warning: running command foo.exe object had status 127` and it always output the same (faulty) results. Any thoughts? – Antoine Apr 04 '16 at 21:40
  • from this [thread](http://stackoverflow.com/questions/31595415/running-c-sharp-exe-program-in-r-getting-error-127) I just used `system(paste0(my_command))` and it worked... – Antoine Apr 04 '16 at 21:44
  • I thought it was working, but I was wrong. Using system is probably the way to go though, but I still have to find the exact way to write/pass the command inside. Please see my new question [here](http://stackoverflow.com/questions/36431465/warning-running-command-had-status-127-when-trying-to-run-exe-from-r) – Antoine Apr 06 '16 at 08:39