AWM useRguide
  • Lab Website
  • Lab Manual
  • R Workshop
  • R Packages
    • englelab
    • psyworkflow
    • semoutput
    • modeloutput
    • pupillometry
  1. Data Scoring
  2. 4  Setup Analysis Project
  • Welcome
  • Installs and Updates
  • Overview
  • Data Preparation
    • 1  Compile Raw Data
    • 2  Tidy Raw Data
    • 3  Data Qualtiy Checks
  • Data Scoring
    • 4  Setup Analysis Project
    • 5  Score and Clean Data
    • 6  Single Merged File
  • Data Analysis
    • 7  ANOVA
    • 8  Regression
  • Appendices
    • Update Packages

Table of contents

  • Setup Folders
  • Copy Data Files
  • Download R Script Templates
    • Copy From Other Projects
  1. Data Scoring
  2. 4  Setup Analysis Project

4  Setup Analysis Project

Data Scoring

For every data collection study there are multiple data analysis projects that result in published papers. The data analysis projects will share common tasks but might use different criteria for scoring, cleaning, and analyzing the data. Because of this, and just for organization, we need to keep data collection and data analysis projects separate.

The data collection repository (SharePoint / Data Collection / [Study Name]) should be where raw and tidy data files, along with some R scripts are stored.

Each data analysis project should be created from the data files in the data collection repository.

Setup Folders

  1. Create a folder for your project that contains the three following folders

πŸ“ analyses

πŸ“ data

πŸ“ R

  1. Inside of the data folder create a raw/messy folder and a scored folder

πŸ“ data

   πŸ“ raw

      πŸ“ messy

   πŸ“ scored

  1. Create an RStudio Project in the project’s root directory

File -> New Project… -> Existing Directory

Copy Data Files

Once you create a data analysis repository in SharePoint/Data Analysis, you can copy over data files for the tasks specific to that research project.

Important

Only copy over the messy raw data files, otherwise your project will not be fully reproducible

Download R Script Templates

The englelab package contains R script templates you can download

In the console window, type:

englelab::get_template(raw_script = TRUE, score_script = TRUE, 
                       merge_script = TRUE, analysis_script = TRUE, 
                       wmc_scripts = TRUE, ac_scripts = TRUE, 
                       main_script = TRUE)

Copy From Other Projects

If R scripts already exist in other projects for processing data from tasks you are using in your current project, then you can also just copy and paste those over to your project.

3  Data Qualtiy Checks
5  Score and Clean Data