read.folder: Reads an entire folder using the read function of your choice

Description Usage Arguments Value Examples

View source: R/read.folder.r

Description

Reads an entire folder using the read function of your choice

Usage

1
2
read.folder(folder.path, read.function = read.csv, recursive = FALSE,
  exclude = NULL, ...)

Arguments

folder.path

The path of the folder

read.function

The function used to read the files. Do not surround in quotes. Deafults to read.csv

recursive

Whether we should look inside subfolders. Defaults to FALSE

exclude

Paths of all files we would like to exclude from reading (for example README files)

Value

This function returns the object (data.frame, data.table, etc) of your choice containing data from all files in the specified folder

Examples

1
2
read.folder("./path/to/folder/", read.function=fread)
read.folder("./path/to/folder/", exclude="./path/to/folder/README.txt", recursive=TRUE, header=FALSE)

michalmonselise/read.folder documentation built on May 22, 2019, 9:53 p.m.