Whats the best way to check the existence of external software in R?

Viewed 37

I want my code to only execute if software exists on my machine external to R. Let's say the external executable is called foo. One way I am thinking about is:

if (nchar(Sys.which("foo")) > 0) {
  # my code
}

Is there a better way?

0 Answers
Related