> For the complete documentation index, see [llms.txt](https://help.imotions.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.imotions.com/lab/analysis/signal-processing-r-notebooks/what-are-r-notebooks.md).

# What are R-Notebooks?

Understand what R and R notebooks are, how they process sensor data in iMotions Lab analyses, and which R notebooks are available for each sensor.

*This article provides an introduction to R-Notebooks. What is the concept? And how can it help your research?*

Any research project includes a number of steps: thinking of a good study design, building the study, collecting data – and there it really only just starts. Hereafter, the researcher assesses the data quality, annotates the data, applies signal processing algorithms (e.g., filtering, normalization, etc.), defines measurements (e.g., peak amplitudes), and carries out statistical tests.

A lot of these steps are “somehow similar” across different research projects, at least conceptually, but the important details tend to differ. For instance, what is an appropriate filter in one study is not necessarily an appropriate filter in another study; it could be that the researcher would want to use different parameters for the algorithm, or even a completely different type of filter. Sometimes the order of the different steps matters, or perhaps the researcher would want to apply this one, additional step: a normalization. Every research project is a long decision-making process, and often, these decisions are not even a matter of *good versus bad* – not even of *better versus worse*. Often it is a matter of personal taste. But also, sometimes it is important to copy the exact methods that other researchers have used in the past, perhaps only for the sake of replicating earlier findings.

Researchers need a level of flexibility in their data analysis, which is very difficult to accommodate to as a software developer – precisely because the needs of different researchers are so versatile. Hard-coded algorithms, hidden in source-code, easily become too rigid. But also, it becomes unclear what exactly was done to the data before obtaining a given measurement. (To some degree, the algorithm becomes a “black box”). It also becomes unclear why certain decisions were made in the development of the algorithm. Why is it that a given filter was chosen, rather than another one? And most importantly: it is impossible, as a user, to adapt the algorithm to your own needs.

For these reasons, iMotions uses R-Notebooks.

## What is ‘R’?

‘R’ is a free and open-source software, which is known and widely used by academic researchers across the world for running statistical analyses. The software uses its own R-language, which is an easy-to-learn programming language, and which gives researchers the flexibility to program their own scripts (or ‘Notebooks’) for analyzing and visualizing data.

## What are ‘R-Notebooks’?

R-Notebooks replace hard-coded signal processing algorithms that were programmed in source code. When you install iMotions, the software ‘R’ is installed in the background – and when, during the analysis in iMotions, an algorithm is being executed, it utilizes the ‘R’ software in the background for carrying out the computations.

With this new initiative we try to combine the best of two worlds: on the one hand, we provide signal processing algorithms, which we are confident that they are good algorithms that serve the needs of most users. On the other hand, by providing access to the R-code itself, we also offer the flexibility to adapt the R-code to the specific needs of individual users.

Click [here](https://help.imotions.com/lab/analysis/signal-processing-r-notebooks/r-notebook-raw-data-aggregation.md) for more information on how to run the R-Notebooks in iMotions.

## List of available R-Notebooks in iMotions

The following R-Notebooks are available in iMotions:

*Galvanic Skin Response (GSR):*

* [GSR peak detection](https://help.imotions.com/lab/analysis/eda-gsr/gsr-r-notebooks-peak-detection-and-aggregation.md)
* [GSR peak binned aggregation](https://help.imotions.com/lab/analysis/eda-gsr/gsr-r-notebooks-peak-detection-and-aggregation.md)
* [GSR Signal Quality](https://help.imotions.com/lab/analysis/eda-gsr/gsr-r-notebooks-gsr-signal-quality.md)
* [GSR Epoching](https://help.imotions.com/lab/analysis/signal-processing-r-notebooks/r-notebook-epoching.md)

*Facial Expression Analysis (FEA):*

* [AFFDEX Thresholding and Aggregation](https://help.imotions.com/lab/analysis/facial-expression-analysis/r-notebook-fea-facial-expression-analysis-thresholding-and-aggregation.md)
* [AFFDEX Blink Detection](https://help.imotions.com/lab/analysis/facial-expression-analysis/affdex/r-notebook-facial-expression-analysis-based-blink-detection.md)
* RealEyes Thresholding Aggregation
* [AFFDEX Raw Data Statistics Export](https://help.imotions.com/lab/analysis/facial-expression-analysis/affdex/r-notebooks-fea-affdex-raw-data-statistics-export.md)

*Electro-encephalography (EEG):*

* [EEG Power Spectral Density](https://help.imotions.com/lab/analysis/eeg/r-notebook-eeg-power-spectral-density-psd.md)
* [EEG Power Spectral Density Aggregation](https://help.imotions.com/lab/analysis/eeg/r-notebook-eeg-power-spectral-density-psd.md)
* EEG Frontal Asymmetry
* EEG Frontal Asymmetry Aggregation
* [EEG Intersubject Correlation](https://help.imotions.com/lab/analysis/eeg/r-notebook-eeg-intersubject-correlation-isc.md)

*Electrocardiography (ECG):*

* [ECG Heart Rate and Heart Rate Variability](https://help.imotions.com/lab/analysis/biosensor-analysis/r-notebooks-ecg-heart-rate-and-hrv-processing.md)

*Electromyography (EMG):*

* [EMG Smoothing and Normalization](https://help.imotions.com/lab/analysis/biosensor-analysis/r-notebook-emg-processing.md)

*Eye Tracking:*

* [eye tracker Blink Detection](https://help.imotions.com/lab/analysis/eye-tracking/other-eye-tracking-analysis/r-notebook-eye-tracking-based-blink-detection.md)

*Skin Temperature:*

* Skin Temperature

*Respiration:*

* [Respiration Processing](https://help.imotions.com/lab/analysis/respiration/r-notebooks-respiration-respiration-processing.md)

*SpO2 Oxygen Saturation:*

* [SpO2 Oxygen Saturation](https://help.imotions.com/lab/analysis/biosensor-analysis/r-notebook-spo2-oxygen-saturation.md)

*All signals:*

* Raw Data Aggregation

*Export:*

* Respondent Statistics Export


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.imotions.com/lab/analysis/signal-processing-r-notebooks/what-are-r-notebooks.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
