This article describes how to switch between editing code in the Properties > R CODE editor:
and output on the page:
Requirements
A Displayr Document
Method
- Create an empty custom R Calculation, click Calculation > Custom Code.
- Click on your page where you wish to display your output and/or R code. A hover button will appear at the top left of the R item when it is selected. This hover button should say Edit (F2).
- Hit F2 or click the Edit(F2) to switch to the code editor (code mode). The hover button will disappear.
- Type your R code into the code editor. Your code will also appear in the R CODE box in the object inspector.
For example, - Click Calculate in the object inspector to run your code. This action will also exit you from the code editor.
- Hit F2 or click Edit (F2) to switch back to code mode. The cursor is placed at the end of the last line in the editor.
While the R item is in code mode, you can still makes changes to OUTPUT > Show as in the object inspector or modify the appearance but these changes will only get reflected on the item when the item leaves the code mode.
Notes
The R item leaves the code mode in the following situations:
- When the item is deselected (e.g. click on the work area).
-
When it is not the only selected item (e.g. two R items are selected or both a R item and a textbox are selected).
- When you click on the Calculate button in the object inspector (in this case the hover button should reappear).
Next