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

sendToConsole

Send code to the R console


Description

Send code to the R console, and optionally execute it.

Usage

sendToConsole(code, execute = TRUE, echo = TRUE, focus = TRUE)

Arguments

code

The R code to be executed, as a character vector.

execute

Boolean; execute the code immediately or just enter the text into the console?

echo

Boolean; echo the code in the console as it is executed?

focus

Boolean; focus the console after sending code?

Note

The sendToConsole function was added in version 0.99.787 of RStudio.

Examples

## Not run: 
rstudioapi::sendToConsole(".Platform", execute = TRUE)

## End(Not run)

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.