This R project provides a clean and modular template for analyzing behavioral data collected using PsychoPy. It is designed to aggregate .csv files exported from PsychoPy, clean and structure them, and compute key performance and signal detection metrics.
✅ Click the “Use this template” button above to create your own analysis-ready repository!
- 🔄 Automatic concatenation of
.csvfiles - 🧼 Data cleaning and formatting (e.g., participant ID, gender)
- 🧠 Signal Detection Theory (SDT) metrics (
d',c) - ⏱️ Reaction time (RT) summaries
- ✅ Accuracy summaries
- 📊 Outlier detection
- 📁 Data export to
.RDataor.xlsx
AnalysisRproj/
├── DESCRIPTION # R package metadata
├── R/ # All core analysis functions
├── data/ # Cleaned datasets saved as .RData
├── original_data/ # Raw .csv files from PsychoPy
├── scripts/ # Custom analysis scripts (e.g., per experiment)
├── LICENSE # MIT License
├── README.md # You’re here!
└── Data_analysis.Rproj # RStudio project fileClick the green “Use this template” button to copy this repo to your own GitHub account.
Or clone it manually:
git clone https://github.com/YOUR_USERNAME/AnalysisRproj.git- Open the project
Open Data_analysis.Rproj in RStudio.
- Load dependencies
Install required packages if you don’t already have them:
install.packages(c("dplyr", "tidyr", "readxl", "openxlsx", "ggplot2", "afex", "emmeans", "effectsize", "devtools"))- Run the analysis write your analysis and keep the scripts in scripts folder
📄 License
This project is licensed under the MIT License.
© 2025 Thomas Quettier
⸻
🤝 Contributions
This repository is a template. You are welcome to fork it, adapt it, and contribute improvements via pull requests. (Collaborators) Please precede your commit's message with one or more of the following:
BF: bug fix FF: feature fix. This is for fixes to code that hasn’t been released RF: refactoring NF: new feature ENH: enhancement (improvement to existing code) DOC: for all kinds of documentation-related commits TEST: for adding or changing tests
⸻
🧠 Acknowledgements
- PsychoPy for stimulus presentation
- R and the tidyverse for data processing
- My website