Skip to content

Latest commit

 

History

24 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Relationships Between Light Exposure and Aspects of Cognitive Function in Everyday Life

This repository contains the analysis scripts for a study investigating the relationships between light exposure and various aspects of cognitive function in everyday life among UK adults.


Project Structure

light-cognition-inreallife-project.Rproj

RStudio project file. Double-click to open in RStudio. Required for features like relative paths using the here package.

src/

  • preprocessing/ – Contains numbered R scripts that must be run in order to preprocess raw data and create required variables.
  • functions/ – Custom R functions used in processing and analysis.
  • figures/ – Contains figures exported by analysis_light_and_cognition.Rmd.
  • figure data/ – Data used to generate plots in GraphPad Prism, exported from the main analysis script.
  • tables/ – Tables exported by analysis_light_and_cognition.Rmd.
  • analysis_light_and_cognition.Rmd – R Markdown file for analysis and reporting. Knitted to a PDF. Uses and exports data from the data/ folder.

data/

This folder should be downloaded from the Figshare repository: DOI-10.48420/28911977.

  • brightertime/ – Cognition, subjective sleepiness, sleep, and baseline survey data collected via the mobile app.
  • light_sensitivity/ – Light sensitivity metrics (PIPR, brightness discrimination, subjective brightness), processed by Weolders et al. (2024). Also includes dose-response slopes between melanopic lux and cognitive function.
  • spectrawear/ – Light exposure data collected by Spectrawear. Includes calculated light exposure metrics and 2-hour history windows before cognitive tasks.

Notes

  • Sunrise and sunset times were calculated for:
    latitude = 53.4808, longitude = -2.2426.

  • All timestamps were recorded in local time (Europe/London) by both Spectrawear and Brightertime.

  • Timestamps in .RData files are stored in POSIXct format ("YYYY-MM-DD HH:MM:SS").
    Although shown in local time, timestamps are labeled as UTC for consistency and ease of comparison.


Installation

To reproduce the analysis, install the required R packages using:

install.packages(c("here", "progress", "data.table", "dplyr", "lubridate", "lme4", "lmerTest", "ggplot2", "wesanderson", "moments", "ggpubr", "corrplot", "reshape2", "stats", "caret", "Hmisc", "car", "openxlsx", "suncalc", "parameters", "performance", "effectsize"))

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages