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 |
Find eprime files
eprime_find(in_dir, task, paths, logs, quietly = FALSE)
eprime_find(in_dir, task, paths, logs, quietly = FALSE)
in_dir |
Directory with E-prime files |
task |
Which task, one of ["Antisaccade", "n-back", "Attention"] |
paths |
list of paths from [ |
logs |
list of paths from [ |
quietly |
logical if log text should be printed in the console |
Will look for new eprime files, and start logging information about them.
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)
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)
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 |
Calls eprime_process_file and runs through each file listed in the provided data.frame to process.
eprime_process_all(ff_df, in_dir, task, MOAS, paths, logs, quietly = FALSE)
eprime_process_all(ff_df, in_dir, task, MOAS, paths, logs, quietly = FALSE)
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 [ |
logs |
list of paths from [ |
quietly |
logical if log text should be printed in the console |
Runs the processing of E-prime files for LCBC. This will check the existance of files, any previous logs for duplicated entries etc.
eprime_process_file(efile_path, in_dir, task, MOAS, paths, logs, start_message = "Starting processing for", quietly = FALSE, return_options = FALSE)
eprime_process_file(efile_path, in_dir, task, MOAS, paths, logs, start_message = "Starting processing for", quietly = FALSE, return_options = FALSE)
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 [ |
logs |
list of paths from [ |
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 |
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.
eprime_resolve_all(in_dir, out_dir, task, MOAS, gmail_user = "[email protected]", .choice = NULL)
eprime_resolve_all(in_dir, out_dir, task, MOAS, gmail_user = "[email protected]", .choice = NULL)
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 |
Will attempt to process the file automatically before prompting for manual input to resolve the issues that are stopping the file from being processed.
eprime_resolve_file(files_date_time, file_date, in_dir, task, paths, logs, MOAS, gmail_user = NULL, quietly = FALSE, .choice = NULL)
eprime_resolve_file(files_date_time, file_date, in_dir, task, paths, logs, MOAS, gmail_user = NULL, quietly = FALSE, .choice = NULL)
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 [ |
logs |
list of paths from [ |
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 |
Initiates logs for each new file, and copies the raw data into the folder structure
eprime_setup_files(ff_df, in_dir, task, logs, paths, quietly = FALSE)
eprime_setup_files(ff_df, in_dir, task, logs, paths, quietly = FALSE)
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 [ |
paths |
list of paths from [ |
quietly |
logical if log text should be printed in the console |
Initiates and creates paths to necessary log-files for the E-prime parser
eprime_setup_logs(out_dir, task, quietly = FALSE)
eprime_setup_logs(out_dir, task, quietly = FALSE)
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 |
list of log paths
Sets up the necessary folder structure, if it does not already exists, for the eprime parser to work
eprime_setup_paths(out_dir, task, logs, quietly)
eprime_setup_paths(out_dir, task, logs, quietly)
out_dir |
directory to output the data to |
task |
Which task, one of ["Antisaccade", "n-back", "Attention"] |
logs |
list of paths from [ |
quietly |
logical if log text should be printed in the console |
list of paths