Grab metadata from files stored in the same folder (e.g. a sequence of trials in an experiment).

get_wl_metadata(file_path, pattern = "*.ddf")

Arguments

file_path

Path where files are stored. Should be in the same folder.

pattern

Regex pattern for identifying relevant files in the file_path.

Value

Either a data.frame (if a single file is supplied) or a list of data.frames (if a list of files is supplied), with information as supplied from file.info().

Details

If several files (e.g. successive trials from one experiment) are stored in one folder, use this function to obtain metadata in a list format. Runs file.info() from base R to extract info from files.

This function is not truly considered to be part of the batch analysis pipeline; see read_analyze_wl_dir() for a similar function that not only grabs metadata but also imports & analyzes files. Instead, get_wl_metadata() is meant to be a handy function to investigate metadata issues that arise if running read_analyze_wl_dir() goes awry.

Unlike read_analyze_wl_dir(), this function does not necessarily need files to all be work loops. Any file type is welcome (as long as the Regex pattern argument makes sense).

See also

Author

Vikram B. Baliga

Examples

library(workloopR) # get file info for files included with workloopR wl_meta <- get_wl_metadata(system.file("extdata/wl_duration_trials", package = 'workloopR'))