R code for JASP should follow JASP's R style guide.
This document will guide you through writing an R analysis for JASP. Two things should be noted before we get started. First, this guide assumes that you have knowledge about basic R concepts such as functions. Second, writing an R analysis is necessary but not sufficient to create a new module for JASP. For this goal, other files (such as the UI, json etc.) need to be created. The creation of these other files is not discussed here.
Every JASP R analysis will consist of several types of functions:
- a single main analysis function that organizes the analysis and its output,
- one or multiple results functions that compute the results that will be displayed,
- one or multiple create functions that create output elements (tables, plots, containers), and