concatenate_csvs: Combine directory of CSVs into a single CSV

View source: R/dev.R

concatenate_csvsR Documentation

Combine directory of CSVs into a single CSV

Description

Combine directory of CSVs into a single CSV

Usage

concatenate_csvs(
  dir,
  cols,
  pattern = NULL,
  merged_name = "merged.csv",
  read = utils::read.csv,
  ...,
  remove_after_merge = FALSE
)

Arguments

dir

Directory of CSVs

cols

Vector of column names; if NULL (default), default column names are applied to the merged CSV (character vector)

pattern

Regular expression to filter files in dir; If NULL (default), all files in dir will be read

merged_name

Name of concatenated CSV; defaults to "merged.csv" (string)

read

Function to read CSV files; defaults to read.csv but other options include data.table::fread

...

Arguments to be passed to read

remove_after_merge

If FALSE (default), files in dir are not removed (boolean)

Value

A CSV called "merged.csv" in dir directory


omkarakatta/ivqr documentation built on Aug. 20, 2022, 11:04 p.m.