Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

executeCommand

Execute Command


Description

Executes an arbitrary RStudio command.

Usage

executeCommand(commandId, quiet = FALSE)

Arguments

commandId

The ID of the command to execute.

quiet

Whether to show an error if the command does not exist.

Details

Most menu commands and many buttons in RStudio can be invoked from the API using this method.

The quiet command governs the behavior of the function when the command does not exist. By default, an error is shown if you attempt to invoke a non-existent command. You should set this to TRUE when invoking a command that may not be available if you don't want your users to see an error.

The command is run asynchronously, so no status is returned.

See the RStudio Server Professional Administration Guide appendix for a list of supported command IDs.

Note

The executeCommand function was introduced in RStudio 1.2.1261.


rstudioapi

Safely Access the RStudio API

v0.13
MIT + file LICENSE
Authors
Kevin Ushey [aut, cre], JJ Allaire [aut], Hadley Wickham [aut], Gary Ritchie [aut], RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.