Description Usage Arguments Value Examples
determine whether an executable is currently available on the user machine (optionally checking for a specific or greater version).
1 | is_available(exec, version = NULL, error = FALSE)
|
exec |
executable identifier, a single character. Use one of these values:
|
version |
required version of executable |
error |
if |
a logical indicating whether the executable is available.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | if (is_available("python")) {
cat("python", as.character(exec_version("python")), "is available!\\n")
}
py_path <- "~/../AppData/Local/Programs/Python/Python39"
if(dir.exists(py_path)){
locate_exec("python", dir = py_path, cache = FALSE)
}
if(is_available("python", "3.9")) {
cat("required version of python is available!\\n")
}
if (is_available("pip")) {
cat("pip", as.character(exec_version("pip")), "is available!\\n")
}
if (is_available("pip", "19.3")) {
cat("pip", as.character(exec_version("pip")), "is available!\\n")
}
if (is_available("chrome")) {
cat("chrome", as.character(exec_version("chrome")), "is available!\\n")
}
if (is_available("node")) {
cat("node.js", as.character(exec_version("node")), "is available!\\n")
}
if (is_available("npm")) {
cat("npm", as.character(exec_version("npm")), "is available!\\n")
}
if (is_available("npm", version = "10.13.0")) {
cat("npm", as.character(exec_version("npm")), "is available!\\n")
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.