merge_files_from_dir: Merges Files of the Same Format

View source: R/merge_files_from_dir.R

merge_files_from_dirR Documentation

Merges Files of the Same Format

Description

crawls the supplied 'dir_path' and searches for files matching 'regex_exp'. It then reads in those files and merges the data into one data frame via appending. Hence, files must have the same data format (number and identity of columns).

Usage

merge_files_from_dir(
  regex_exp,
  dir_path = NULL,
  debug = "no",
  include_file_information = FALSE,
  ...
)

Arguments

regex_exp

A regular expression. Only file names which match the regular expression will be returned.

dir_path

a character vector of full path names; the default corresponds to the working directory, getwd. Tilde expansion (see path.expand) is performed. Missing values will be ignored. Elements with a marked encoding will be converted to the native encoding (and if that fails, considered non-existent). See list.files.

debug

debug options. Must be one of "no", "return.names", or "print.bad.files". Defaults to "no".

include_file_information

whether to include some path information to the returned data set.

...

additional arguments that will be supplied to the underlying fread function

Value

merged dataset


mc-schaaf/rainR documentation built on July 19, 2023, 5:09 p.m.