Debugging Locally with RStudio
While models can be developed directly in Akumen’s code editor, we recognise that everybody has their own workflow that they like to follow, and software that they like to use. In this section, we teach you how to set up your model in RStudio so that it executes in exactly the same manner as Akumen, giving you the interactivity of RStudio combined with the confidence that your code will run as-expected in Akumen.
The basic steps to enable local debugging in RStudio is as follows:
- Create your application, either new or from Git, in Akumen.
- Set up your research inputs for at least one scenario.
- Execute the scenario.
- Right-click on the scenario and select
Artifacts
to download the model artifact zip. - Extract the zipfile onto your local computer.
- Open RStudio and create a new project, using the extracted zip folder as the “existing folder”.
- Select
Session -> Set Working Directory
and set the directory to the extracted zip folder. - Open the
command.R
source file in RStudio. - Hit
Source
, which will automatically drop RStudio into a debugger session within theakumen()
function. - Perform any experimentation, development that you wish in the console.
- If changes are made within the
akumen()
function or other model code, simply restart the debugger session.
There is a sample video of this process below: