| shell | R Documentation |
shell runs the command specified bycmd, usually undera shell, because that is what the POSIX standards require.
shell(cmd, shell, flag = "/c", intern = FALSE, wait = TRUE, translate = FALSE, mustWork = FALSE, ...)
cmd | the system command to be invoked, as a string. |
shell | a string giving the name of the shell to be used, or |
flag | the switch to run a command under the shell. If the shellis |
intern | a logical, indicates whether to make the output of thecommand anR object. |
wait | should theR interpreter wait for the command to finish?The default is to wait, and the interpreter will always wait if |
translate | If |
mustWork | a logical; if |
... | additional arguments to |
If noshell is specified, the environment variablesR_SHELL andCOMSPEC are tried in turn:COMSPECshould always succeed. Usingshell = NULL invokes the commandcmd directly, in which case an extension of ‘.exe’ isassumed. It is possible to use batch files directly if theirextension is given: Windows (rather thanR) then chooses a shell.
Seesystem for fuller details:shell is a moreuser-friendly wrapper forsystem. To make use of Windowsfile associations, useshell.exec.
Ifintern = TRUE, a character vector giving the output of thecommand, one line per character string, or an error message if thecommand could not be run.
Ifintern = FALSE, the return value is an error code, given theinvisible attribute (so needs to be printed explicitly). If thecommand could not be run for any reason, the value is-1 andanR warning is generated. Otherwise ifwait = FALSE the valueis the error code returned by the command, and ifwait = TRUEit is the zero (the conventional success value),
Ifintern = FALSE andwait = TRUE (the defaults) the textoutput from a command that is a console application will appear intheR console (Rgui) or the window runningR (Rterm).
This function exists only on Windows: on all other platformsystem uses a shell.
system,shell.exec
Add the following code to your website.
For more information on customizing the embed code, readEmbedding Snippets.
