This article describes how to use the Code panel in Displayr to create and modify R-based Variables and Calculations in your Document. Note that R-based Data Sets do not use the Code Editor panel; for guidance, see below.
Accessing R code for R Data Sets
Requirements
A Displayr document with at least one of the following:
- An existing object that is built using R code,
- An object that contains R code, or
- A new custom calculation, R variable, or R data set.
Accessing the R Code Panel
When you create a new R item, the Code panel will automatically appear below the page:
Otherwise, to access the Code panel for Variables and Calculations:
Method 1 - From the Properties panel:
- Select the object that contains R code (see above requirements).
- From Properties
, go to Data > Attributes > Code.
Method 2 - From the floating toolbar buttons on an object or variable set:
Click the Code icon in the floating toolbar directly above or below the object or variable set when selected.
Closing the R code panel
When you are finished editing the R code in a calculation, you can manually close the panel in one of the following ways:
- By using the X button in the upper-right corner of the Code
panel.
- By pressing the Code button in Properties
> Data > Attributes.
- By clicking the
icon in the floating toolbar that appears directly above or below the selected item.
Resizing the R code panel
You can adjust the code panel's height by dragging the panel up or down. The height is remembered as long as you do not clear your browsing data/cache for Displayr.
Accessing R code for R Data Sets
The code for an R Data Set:
- In the Data Sources pane, select the R data set's name.
- From the floating toolbar, click Update
.
- A dialogue with a field for the name of your data set and a code editor will pop up.
UPCOMING WEBINAR: Run Research Your Way With AI Skills