R Shell
An interactive R Shell that can be used to execute R commands in the cloud using OpenCPU.
Options
- code |
string
: R code to be evaluated. Default:''
. - solution |
string
: for programming questions, R codestring
representing the official solution for the problem. Default:''
. - hints |
array<(string|node)>
: for programming questions, an array of hints providing guidance on how to approach the problem. Default:[]
. - addPreceding |
boolean
: if set to true, the shell will evaluate all the code from the current component and all previous ones occurring in the lesson. Default:false
. - libraries |
array
: R libraries that should be loaded automatically when the inputcode
is executed. Default:[]
. - precompute |
boolean
: controls whether the default code should be executed once the component has mounted. Default:false
. - prependCode |
(string|array)
: R codestring
(orarray
of R code blocks) to be prepended to the code stored incode
when evaluating. Default:''
. - chat |
boolean
: controls whether group chat functionality should be enabled. Default:false
. - disabled |
boolean
: controls whether to disable all user inputs and make the code block static. Default:false
. - lines |
number
: number of lines to display. Default:5
. - resettable |
boolean
: controls whether to display a reset button for restoring the default code input. Default:false
. - style |
object
: CSS inline styles. Default:{}
. - onChange |
function
: callback invoked whenever the text field input changes. Default:onChange() {}
. - onEvaluate |
function
: callback invoked whenever theEvaluate
button is clicked. Default:onEvaluate(){}
. - onResult |
function
: callback invoked whenever the result of a code execution is obtained from the cloud. The resultstring
is passed as the only argument to the callback function. Default:onResult() {}
.
Examples
- Minimal
- Multiline
- Precompute & Disabled
- Using Libraries
- Add Preceding Code
- Hints & Solution
Live Editor
Result
ReferenceError: Provider is not defined