system(command, intern = FALSE, ignore.stdout = FALSE, ignore.stderr = FALSE, wait = TRUE, input = NULL, show.output.on.console = TRUE, minimized = FALSE, invisible = TRUE)
command | a character string giving the command to invoke. |
intern | a logical value. If TRUE, the output of command is captured as a character vector. If FALSE (the default), the command is directly executed. |
ignore.stdout, ignore.stderr | a logical value. If TRUE, ignores the message written to stdout or stderr. The default is FALSE. |
wait | a logical value. If TRUE (the default), the command is run in synchronous mode and system is not returned until command completes. If FALSE, the command is run in asynchronous mode. This option is useful when you want to use the engine and the application (command invoked) concurrently. If intern is TRUE, this argument is ignored and command is always run in "wait" mode. |
input | a character vector. If specified, each character string is written to one line of a temporary file and this file is redirected as standard input of command. |
show.output.on.console | a logical value. If TRUE (the default), the output is displayed in the console. |
minimized | a logical value. If TRUE, runs the command in minimized windows. The default is FALSE. |
invisible | a logical value. if TRUE (the default), runs the command in invisible mode. |
## Not run: # Windows examples: system("cmd") system("cmd", intern = TRUE) ret <- system("cmd", ignore.stdout = TRUE) ret ## 0ret <- system("mycmd") ## Warning message: ## running command 'mycmd' had status 127 ret ## [1] 127
# Run notepad in "wait" mode. system("Notepad abc.txt", invisible = FALSE)
# Run notepad concurrently system("Notepad", wait = FALSE, invisible = FALSE)
# Run notepad in minimized window. system("Notepad", minimized = TRUE, invisible = FALSE)
# Unix examples: system("ls", intern = TRUE) system("ls") ## End(Not run)