bulk_in: Efficiently bulk load a directory of csv or excel files

Description Usage Arguments Details Value Examples

View source: R/bulk_in.R

Description

Bulk loads csv or excel files contained in a directory into a dataframe

Usage

1
bulk_in(input_directory, type, sheet_name = NULL, safe_mode = FALSE)

Arguments

input_directory

the directory to import the files from

type

the type of input file ("csv" or "excel")

sheet_name

(optional) name of the excel sheet to import (same in all files) default = NULL

safe_mode

should safemode be used? (default = FALSE)

Details

This function recursively finds all csv / excel files in a folder and loads them all into a single dataframe. Note will only deal with either excel or csv not a mixture.

Uses the read_excel function from readxl for excel import - if no sheet_name is provided (or is NULL) then will read in the first sheet by default. The column types will be guessed when the data is read in.

The package uses data.table's rbindlist function for performance reasons. This is fast but binds based on column position rather than matching column names. If this causes issues then use safe_mode = TRUE which uses a slower match based on column names.

Value

A dataframe of containing all of the data from the files

Examples

1
2
3
4
## Not run: 
# to add

## End(Not run)

MarkGoble/mishMashr documentation built on Oct. 12, 2020, 8:24 p.m.