Cross-platform function to pass a command to the shell, using either base::system() or (Windows-only) base::shell(), depending on the operating system.

execshell(commandstring, intern = FALSE, path = ".", ...)

Arguments

commandstring

The system command to be invoked, as a string. Multiple commands can be combined in this single string, e.g. with a multiline string.

intern

a logical (not NA) which indicates whether to capture the output of the command as an R character vector.

path

The path from where the command string needs to be executed

...

Other arguments passed to base::system() or base::shell().