stack_csv: Concatenate multiple csv files

Description Usage Arguments Details See Also Examples

View source: R/datafunctions.R

Description

Will either search for .csv files from a specified directory and combine them or use a vector of file names to combine .csv files.

Usage

1
stack_csv(folder, files, search = TRUE, ...)

Arguments

folder

path to folder that contains a list of .csv files. Defaults to working directory if neither "folder" or "files" is specified.

files

A character string or vector of files to be combined as absolute paths or relative to working directory.

search

Whether or not to search subfolders for csv files within the root folder. Defaults to TRUE.

...

Other arguments passed along to data.table::fread

Details

The column names for all csv files you wish to concatenate need to be identical. Once complete, it will combine the files into a single data frame. You can turn search off to only use the root folder.

See Also

read.csv

Examples

1
2
3
4
5
6
# Without arguments: searches for csv's in current folder and subdirectories
stack_csv()

stack_csv("~/Desktop")

stack_csv(files=c("file1.csv", "file2.csv"))

iamamutt/mejr documentation built on May 18, 2019, 1:27 a.m.