0

I try to automate a simple workflow. Its a oneliner in Terminal, nothing really special. And also tested via Terminal - it works perfect.

During this workflow R should be started via Automator (run a shell script). But it's impossible to start R via Automator (run shell script). Interesting: It is also impossible to run "psql" via automator-shell script, but "Python" works.

Whats the secret behind that? (R & psql runs perfect via normal Terminal.)

2
  • If you don't need an interactive session, use Rscript -e 'library(myLibrary);mySuperScript'. Commented Jul 17, 2014 at 7:46
  • possible duplicate of Run Shellscript from Mac Automator Commented Aug 7, 2014 at 4:20

1 Answer 1

0

In (mac) OS X, start an automator process with Run Shell Script action.

Try with this command :

Rscript -e "system('say hello')"

It should work.

Example with shiny app :

Rscript -e "library(shiny);runExample('01_hello',launch.browser = T)"
Sign up to request clarification or add additional context in comments.

7 Comments

Nearly perfect! With Rscript the browser start - and nothing happens. From Terminal, perfect. I run this command: Rscript -e "shiny::runApp(('/Users/ABC/Documents/Git/RShiny/shinyapp'),launch.browser=TRUE))" Automator uses a other shall than the "normal" $BASH. But which one?
I don't know what's going on with your shiny app. Try the example in my answer : does it work ? In automator shell script, is the shell set to /bin/bash ?
"dyld: Library not loaded: /usr/local/lib/gcc/x86_64-apple-darwin13.2.0/4.8.3/libgfortran.3.dylib Referenced from: /usr/local/Cellar/r/3.1.1/R.framework/Versions/3.1/Resources/lib/libR.dylib Reason: image not found"
It's the output of the shiny example ?? It's look like R doesn't find gfortran libraries. If you type "which gfortran" in your terminal, do you have something ? If not, maybe you should install gfortran with homebrew : brew install gfortran. But, there maybe another problem, unrelated with your first question.
Terminal output for "which gfortran": /usr/local/bin/gfortran
|

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.