PupillometryR

PupillometryR: An R package for preparing and analysing pupillometry data - Published in JOSS (2020)

https://github.com/samhforbes/pupillometryr

Science Score: 93.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 15 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Scientific Fields

Engineering Computer Science - 60% confidence
Earth and Environmental Sciences Physical Sciences - 40% confidence
Last synced: 4 months ago · JSON representation

Repository

An R package for preparing and analysing pupillometry data

Basic Info
  • Host: GitHub
  • Owner: samhforbes
  • License: other
  • Language: R
  • Default Branch: master
  • Size: 15.3 MB
Statistics
  • Stars: 46
  • Watchers: 4
  • Forks: 4
  • Open Issues: 5
  • Releases: 4
Created almost 7 years ago · Last pushed 7 months ago
Metadata Files
Readme Changelog License

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# PupillometryR


[![CRAN status](https://www.r-pkg.org/badges/version/PupillometryR)](https://CRAN.R-project.org/package=PupillometryR)
[![Travis build status](https://app.travis-ci.com/samhforbes/PupillometryR.svg?branch=master)](https://app.travis-ci.com/samhforbes/PupillometryR)
[![DOI](https://joss.theoj.org/papers/10.21105/joss.02285/status.svg)](https://doi.org/10.21105/joss.02285)



The goal of PupillometryR is to to pre-process and then analyze simple pupil
experiments in R.

## Installation

You can install the released version of PupillometryR from [CRAN](https://CRAN.R-project.org) with:

``` r
install.packages("PupillometryR")
```

And the development version from [GitHub](https://github.com/) with:

``` r
# install.packages("devtools")
devtools::install_github("samhforbes/PupillometryR")
```
## Setup

This package (and the example dataset) was designed in part, based on Sylvain Sirois' MATLAB tutorial, [which can be found here](https://oraprdnt.uqtr.uquebec.ca/pls/public/gscw031?owa_no_site=314&owa_no_fiche=3&owa_bottin=https://oraprdnt.uqtr.uquebec.ca/pls/public/gscw031?owa_no_site=314&owa_no_fiche=3&owa_bottin=).

The intention is an integrated pipeline for pupillometric experiments, from data cleaning, pre-processing, various analysis techniques, and visualising results.

To use all the functionality and plots that follow from the PupillometryR pipeline, please start with *make_pupillometryr_data*, e.g.:

```{r example}
library(PupillometryR)

data("pupil_data")

#Check that IDs are not numeric
pupil_data$ID <- as.character(pupil_data$ID)
#remove participant number 8, who had problematic data
pupil_data <- subset(pupil_data, ID != 8)
#blinks were registered as -1, so replace with NAs
pupil_data$LPupil[pupil_data$LPupil == -1] <- NA
pupil_data$RPupil[pupil_data$RPupil == -1] <- NA

Sdata <- make_pupillometryr_data(data = pupil_data,
                                 subject = ID,
                                 trial = Trial,
                                 time = Time,
                                 condition = Type)
```

All further functions associated with the package follow from there. 
For example:

```{r}
plot(Sdata, pupil = LPupil, group = 'condition')
```

To follow a detailed walkthrough, run:

```{r eval = F}
vignette('PupillometryR')
```

or head to [samforbes.me/PupillometryR](http://samforbes.me/PupillometryR/).

## Getting help

Please use the issues tab (https://github.com/samhforbes/PupillometryR/issues) to file any bugs or suggestions.
For general pupillometry information, I recommend [Sylvain's website](https://oraprdnt.uqtr.uquebec.ca/pls/public/gscw031?owa_no_site=314&owa_no_fiche=3&owa_bottin=https://oraprdnt.uqtr.uquebec.ca/pls/public/gscw031?owa_no_site=314&owa_no_fiche=3&owa_bottin=), [as well as Jackson and Sirois (2009)](https://doi.org/10.1111/j.1467-7687.2008.00805.x). For reading about using GAMs in pupillometry [this paper by van Rij et al. is excellent](https://journals.sagepub.com/doi/10.1177/2331216519832483), for general GAMs knowledge I recommend [this tutorial by Michael Clark](https://m-clark.github.io/generalized-additive-models/case_for_gam.html) as well as the mgcv documentation, and for general FDA information [this website is helpful](https://www.psych.mcgill.ca/misc/fda/resources.html), along with the Ramsay and Silverman book (1997). Additionally, check out the [raincloud plots paper by Allen et al.](https://wellcomeopenresearch.org/articles/4-63#:~:text=In%20essence%2C%20raincloud%20plots%20combine,error%2C%20such%20as%20a%20boxplot.), which is used for some of the in-built plotting in this package.

## Citation

Please cite the JOSS paper for this package if you use it:
Forbes, S. (2020). PupillometryR: An R package for preparing and analysing pupillometry data. Journal of Open Source Software, 5(50), 2285. https://doi.org/10.21105/joss.02285

## Acknowledgements

This package has had suggestions, encouragement, and help from a number of people, but I wish to especially highlight Sylvain Sirois and Mihaela Duta, whose input has been instrumental. I'd also like to thank Jacolien van Rij for her input with the GAMs modelling portion of this tutorial, and TJ Mahr for contributing to extending the use of GAMs in the vignette.

## References

[1] Jackson, I., & Sirois, S. (2009). Infant cognition: Going full factorial with pupil dilation. *Developmental Science*, 12(4), 670-679. https://doi.org/10.1111/j.1467-7687.2008.00805.x

[2] Allen, M., Poggiali, D., Whitaker, K., Marshall, T. R., & Kievit, R. (2019). Raincloud plots: a multi-platform tool for robust data visualization. *Wellcome Open Research*, 4, 1-41.
https://doi.org/10.12688/wellcomeopenres.15191.1

[3] Ramsay, J.O., & Silverman, B.W. (1997). *Functional data analysis*. New York: Springer-Verlag.

[4] van Rij, J., Hendriks, P., van Rijn, H., Baayen, R. H., & Wood, S. N. (2019). Analyzing the time course of pupillometric data. *Trends in Hearing*, 23, 233121651983248. https://doi.org/10.1177/2331216519832483

Owner

  • Name: Sam Forbes
  • Login: samhforbes
  • Kind: user
  • Location: Durham, UK

Assistant Professor in Psychology at Durham University

JOSS Publication

PupillometryR: An R package for preparing and analysing pupillometry data
Published
June 20, 2020
Volume 5, Issue 50, Page 2285
Authors
Samuel H. Forbes ORCID
School of Psychology, University of East Anglia
Editor
Olivia Guest ORCID
Tags
Pupillometry Eye-tracking

GitHub Events

Total
  • Issues event: 4
  • Watch event: 2
  • Issue comment event: 8
  • Push event: 7
  • Pull request event: 5
  • Fork event: 1
Last Year
  • Issues event: 4
  • Watch event: 2
  • Issue comment event: 8
  • Push event: 7
  • Pull request event: 5
  • Fork event: 1

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 140
  • Total Committers: 4
  • Avg Commits per committer: 35.0
  • Development Distribution Score (DDS): 0.036
Past Year
  • Commits: 8
  • Committers: 2
  • Avg Commits per committer: 4.0
  • Development Distribution Score (DDS): 0.375
Top Committers
Name Email Commits
Sam s****s@g****m 135
Tommaso Ghilardi t****3@g****m 3
TJ Mahr t****r 1
Stefan Appelhoff s****f@m****g 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 27
  • Total pull requests: 8
  • Average time to close issues: 4 months
  • Average time to close pull requests: about 2 months
  • Total issue authors: 16
  • Total pull request authors: 3
  • Average comments per issue: 2.41
  • Average comments per pull request: 0.75
  • Merged pull requests: 7
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 3
  • Pull requests: 6
  • Average time to close issues: 3 months
  • Average time to close pull requests: 3 months
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 0.67
  • Average comments per pull request: 0.67
  • Merged pull requests: 5
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • drmowinckels (6)
  • paulinepalma (3)
  • TommasoGhilardi (3)
  • bruceewmesmo (2)
  • yaoxi-psy (2)
  • jrhougland (1)
  • irmakoz1 (1)
  • christinasen (1)
  • bababen (1)
  • ufangYang (1)
  • KarinvdB (1)
  • FDamon (1)
  • catsquito-dl (1)
  • gzzat (1)
  • celineRR (1)
Pull Request Authors
  • TommasoGhilardi (6)
  • sappelhoff (1)
  • tjmahr (1)
Top Labels
Issue Labels
enhancement (3)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 517 last-month
  • Total dependent packages: 2
  • Total dependent repositories: 3
  • Total versions: 5
  • Total maintainers: 1
cran.r-project.org: PupillometryR

A Unified Pipeline for Pupillometry Data

  • Versions: 5
  • Dependent Packages: 2
  • Dependent Repositories: 3
  • Downloads: 517 Last month
Rankings
Stargazers count: 7.6%
Forks count: 14.2%
Average: 14.5%
Downloads: 16.3%
Dependent repos count: 16.5%
Dependent packages count: 18.1%
Maintainers (1)
Last synced: 4 months ago

Dependencies

DESCRIPTION cran
  • dplyr * depends
  • ggplot2 * depends
  • rlang * depends
  • data.table * imports
  • fda * imports
  • itsadug * imports
  • lazyeval * imports
  • mgcv * imports
  • signal * imports
  • stats * imports
  • stringr * imports
  • tidyr * imports
  • utils * imports
  • zoo * imports
  • knitr * suggests
  • rmarkdown * suggests