multiple_file_reader: Batch read files from a directory

Description Usage Arguments Value Examples

Description

The function reads a batch of files within one directory and concatenates them into one data.frame (or equivalent structure). This is useful, when your data of each participant is stored in a separate file.

Usage

1
multiple_file_reader(files, extension, reader_function, path = ".", ...)

Arguments

files

Usually, a vector of character strings with the names of the files to read in

extension

A character string for the file extension like csv, tsv. Only csv supported right now.

reader_function

The function to use for reading individual files

path

A character string indicating the path to the files to read

...

Additional parameters for the reader function, like sep or dec

Value

A data frame (or equivalent structure) with the concatenated files

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 

files_names <- letters[1:3]

# Reads three files with .csv extension in the working directory using readr::read_csv

my_data <- multiple_file_reader(file_names, ".csv", reader::read_csv)



## End(Not run)

tgraf0/xlincHelpers documentation built on May 5, 2019, 1:36 a.m.