The system command which reports on the full path names of
an executable (including an executable script) as would be executed by
a shell, accepting either absolute paths or looking on the path.
On Windows an ‘executable’ is a file with extension
.exe, .com, .cmd or .bat. Such files need
not actually be executable, but they are what system
tries.
On a Unix-alike the full path to which (usually
/usr/bin/which) is found when R is installed.