Skip to contents

Lightweight, convenience wrapper around base::Sys.which() and base::normalizePath().

Usage

sys_which(x, winslash = "/", ...)

Arguments

x

Passed to Sys.which() names argument.

winslash

the separator to be used on Windows – ignored elsewhere. Must be one of c("/", "\\").

...

Arguments passed on to base::normalizePath

path

character vector of file paths.

mustWork

logical: if TRUE then an error is given if the result cannot be determined; if NA then a warning.

Value

Character vector of paths, if found. If not found returns NULL instead of "".

Examples

if (FALSE) { # \dontrun{
sys_which("gdal")
} # }