Package 'eprimeParser'

Title: LCBC E-prime data processing pipeline
Description: This package contains functions to process the eprime data for LCBC. The functions are adaptations of scripts James Michael Roe made, that Athanasia Monika Mowinckel converted.
Authors: Athanasia Mo Mowinckel [aut, cre] , James Michael Roe [aut]
Maintainer: Athanasia Mo Mowinckel <[email protected]>
License: MIT + file LICENSE
Version: 0.0.1.0
Built: 2024-11-10 04:45:29 UTC
Source: https://github.com/LCBC-UiO/eprimeParser

Help Index


Find eprime files

Description

Find eprime files

Usage

eprime_find(in_dir, task, paths, logs, quietly = FALSE)

Arguments

in_dir

Directory with E-prime files

task

Which task, one of ["Antisaccade", "n-back", "Attention"]

paths

list of paths from [eprime_setup_dirs]

logs

list of paths from [eprime_setup_logs]

quietly

logical if log text should be printed in the console


Parse LCBC E-prime files

Description

Will look for new eprime files, and start logging information about them.

Usage

eprime_parse(in_dir = "/Users/athanasm/LCBC/Projects/Cross_projects/computer_tasks",
  out_dir = "/Users/athanasm/Desktop/tasks", task = "n-back",
  MOAS = "/Users/athanasm/LCBC/Projects/Cross_projects/MOAS/Data/MOAS.RData",
  quietly = FALSE)

Arguments

in_dir

Directory with E-prime files

out_dir

directory to output the data to

task

Which task, one of ["Antisaccade", "n-back", "Attention"]

MOAS

Either string with path to, or as data.frame, the MOAS dataframe

quietly

logical if log text should be printed in the console


Process all files

Description

Calls eprime_process_file and runs through each file listed in the provided data.frame to process.

Usage

eprime_process_all(ff_df, in_dir, task, MOAS, paths, logs,
  quietly = FALSE)

Arguments

ff_df

data frame of files to process from status.log

in_dir

Directory with E-prime files

task

Which task, one of ["Antisaccade", "n-back", "Attention"]

MOAS

Either string with path to, or as data.frame, the MOAS dataframe

paths

list of paths from [eprime_setup_dirs]

logs

list of paths from [eprime_setup_logs]

quietly

logical if log text should be printed in the console


Process an E-prime file for LCBC

Description

Runs the processing of E-prime files for LCBC. This will check the existance of files, any previous logs for duplicated entries etc.

Usage

eprime_process_file(efile_path, in_dir, task, MOAS, paths, logs,
  start_message = "Starting processing for", quietly = FALSE,
  return_options = FALSE)

Arguments

efile_path

path to E-prime txt file

in_dir

Directory with E-prime files

task

Which task, one of ["Antisaccade", "n-back", "Attention"]

MOAS

Either string with path to, or as data.frame, the MOAS dataframe

paths

list of paths from [eprime_setup_dirs]

logs

list of paths from [eprime_setup_logs]

start_message

string message to add to log for this action

quietly

logical if log text should be printed in the console

return_options

logical if options generated for the file should be returned to user


Attempt manual resolve on all files that are not completed

Description

Will check the status.log for files that need resolution, and attempt to resolve their issues. This inclused attempting to process the files automatically before prompting for manual input to resolve the issues that are stopping the file from being processed.

Usage

eprime_resolve_all(in_dir, out_dir, task, MOAS,
  gmail_user = "[email protected]", .choice = NULL)

Arguments

in_dir

Directory with E-prime files

out_dir

directory to output the data to

task

Which task, one of ["Antisaccade", "n-back", "Attention"]

MOAS

Either string with path to, or as data.frame, the MOAS dataframe

gmail_user

Email with access to the LCBC test calendar on google

.choice

never to be set by the user. Created for unit testing only


Attempt manual resolve on a file that is not completed

Description

Will attempt to process the file automatically before prompting for manual input to resolve the issues that are stopping the file from being processed.

Usage

eprime_resolve_file(files_date_time, file_date, in_dir, task, paths, logs,
  MOAS, gmail_user = NULL, quietly = FALSE, .choice = NULL)

Arguments

files_date_time

The unique file name for file that needs processing (found in status.log)

file_date

the date of the session for the file that needs processing (found in status.log)

in_dir

Directory with E-prime files

task

Which task, one of ["Antisaccade", "n-back", "Attention"]

paths

list of paths from [eprime_setup_dirs]

logs

list of paths from [eprime_setup_logs]

MOAS

Either string with path to, or as data.frame, the MOAS dataframe

gmail_user

Email with access to the LCBC test calendar on google

quietly

logical if log text should be printed in the console

.choice

never to be set by the user. Created for unit testing only


Setup the raw files in the system

Description

Initiates logs for each new file, and copies the raw data into the folder structure

Usage

eprime_setup_files(ff_df, in_dir, task, logs, paths, quietly = FALSE)

Arguments

ff_df

data frame of files to process from status.log

in_dir

Directory with E-prime files

task

Which task, one of ["Antisaccade", "n-back", "Attention"]

logs

list of paths from [eprime_setup_logs]

paths

list of paths from [eprime_setup_dirs]

quietly

logical if log text should be printed in the console


Set up logs for eprime parser

Description

Initiates and creates paths to necessary log-files for the E-prime parser

Usage

eprime_setup_logs(out_dir, task, quietly = FALSE)

Arguments

out_dir

directory to output the data to

task

Which task, one of ["Antisaccade", "n-back", "Attention"]

quietly

logical if log text should be printed in the console

Value

list of log paths


Set up directories for E-prime parsing

Description

Sets up the necessary folder structure, if it does not already exists, for the eprime parser to work

Usage

eprime_setup_paths(out_dir, task, logs, quietly)

Arguments

out_dir

directory to output the data to

task

Which task, one of ["Antisaccade", "n-back", "Attention"]

logs

list of paths from [eprime_setup_logs]

quietly

logical if log text should be printed in the console

Value

list of paths