R Shell
An interactive R Shell that can be used to execute R commands in the cloud using OpenCPU.
Example:
<RShell
code="abs(c(-2,3,-1))"
/>
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
: 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
. - fontFamily |
string
: font-family used in the shell window. Default:'Courier New'
. - fontSize |
number
: used font size in the shell window. Default:16
. - 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:{}
. - 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() {}
.