This repository contains the R scripts to curate, ensure quality control, and validate the raw data collected via the S-Interface and other tools in the "Office Tasks 2019" project.
- R and RStudio
- Required packages
Packages are available on CRAN and can be installed using a simple call to install.packages()
:
install.packages('PackageName')
-
Data Curation (dc)
- dc-curate-and-process-physiological-data.R
- For each participant the script does the following:
- Reads the *pp.csv (original perinasal perspiration signal data), removes noise, downsamples to 1 frame per second (fps).
- Reads the session markers file and splits each PP signal into treatment segments.
- Reads the E4 and BioHarness signal files, downsamples them, and merges them with the PP signal file.
- For each participant the script does the following:
- dc-nlp-processor.R
- Note: Run the following line once:
- initCoreNLP(mem = "4g")
- Note: Run the following line once:
- dc-essay-email-extractor.R
- Gathers and merges all report and email responses for n=63 participants.
- dc-curate-and-process-physiological-data.R
-
Quality Control - first level (qc1)
- qc1.Rmd
- Generates the combined file for all signals:
- Unfiltered data option (@1 fps)
- Set the variable value to FALSE: is_filter_data = F
- Quality Control 1 data option (@1 fps)
- Set the variable value to TRUE: is_filter_data = T
- Unfiltered data option (@1 fps)
- Generates the combined file for all signals:
- qc1.Rmd
-
Quality Control - second level (qc2)
- qc2.Rmd
- Performs a second level of filering (quality control 2).
- qc2.Rmd
-
Validation Scripts (vs)
- vs-supplementary-plots.Rmd
- vs-time-series-plots.Rmd
- vs-validation-plots.R
- vs-mean-signal-distribution.Rmd
- vs-hr-regression-and-distribution-plot.Rmd
- vs-c-hr-w-hr-comparison-plot.Rmd
- vs-performance-data-analysis.Rmd
- vs-questionnaire-data-analysis.Rmd
- vs-time-series-plot-hrv.R
- vs-validation-plot-hrv.R
-
FINISHER
- format-final-data.R
- Converts the curated dataset into a user-friendly version.
- Note: This is the last script to run. Please do not run any script after this.
- format-final-data.R
Utility Scripts (us)
- common-functions.R
- Useful functions that are called from almost all scripts.
- us-filter-pp.R
- Removes noise from PP signals. It is called from dc-curate-and-process-physiological-data.R
- us-down-sample-pp.R
- Downsamples data to 1 fps. It is called from dc-curate-and-process-physiological-data.R
- us-score-psychometrics.R
- Scores psychometric variables. It is called from vs-questionnaire-data-analysis.Rmd