This article describes how to switch between code editor and output on the page
A Displayr Document
- 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).
- 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
- Click Calculate in the Object Inspector to run your code. This action will also exit you from the code editor
- 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.
Exiting Code Mode
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).