1

I was trying to invoke an executable from within R code using the system command. If I use command line in a terminal to invoke R, and then execute system("mothur"). However, if from within an R script (on RStudio) I execute the same command, I get: sh: mothur: command not found.

In both cases, the current working directory is the same.

Do I need to invoke the command in a different manner?

thanks!

www
  • 38,575
  • 12
  • 48
  • 84
bsmith
  • 389
  • 2
  • 3
  • 13

1 Answers1

0

I'm stuggling to replicate this problem on my own system, but I think the answer would be to call which and use the output to open the application. This should work if which provides the correct path when used in the system command line:

system("$(which mothur)")
Jay Achar
  • 1,156
  • 9
  • 16