rstudioapi (version 0.11)

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

Character vector containing code to be executed.

execute

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

echo

Boolean; echo the R code in the console as it's executed?

focus

Boolean; focus the R console after sending code?

Examples

Run this code
# NOT RUN {
rstudioapi::sendToConsole(".Platform", execute = TRUE)
# }
# NOT RUN {
# }

Run the code above in your browser using DataCamp Workspace