Skip to main content

R Plot

Component for rendering an R plot inside an ISLE lesson.

Options

  • code | string: R code to generate the plot. Default: ''.
  • width | (number|string): width of the plot (in px). Default: 600.
  • height | (number|string): height of the plot (in px). Default: 'auto'.
  • draggable | boolean: controls whether the plot should be draggable. Default: false.
  • fileType | string: file type of the plot (png or svg). Default: 'svg'.
  • libraries | array: R libraries that should be loaded automatically when the input code is executed. Default: [].
  • prependCode | (string|array): string or an array of R code snippets to be prepended to the code stored in code when evaluating. Default: ''.
  • meta | object: plot meta-information. Default: none.
  • className | string: class name. Default: ''.
  • onDone | function: callback invoked with err, img and body arguments once a plot is created. Default: onDone() {}.

Examples

Live Editor
Result
ReferenceError: Provider is not defined