read.csv.all: Read all CSV files found in search string

View source: R/data_misc.R

read.csv.allR Documentation

Read all CSV files found in search string

Description

This function uses Sys.glob to search for files matching a given string and then cycles through those files, reading them in as CSVs. This function assumes that all your CSV files are the same format or at least can be 'rbind'ed together.

Usage

read.csv.all(search_str, add_file_num = F, debug = F)

Arguments

search_str

string to pass to Sys.glob for the search

add_file_num

Optional: add an additional column (file_num) to indicate the count in the list of files being imported

debug

Optional: print out debugging messages during operation

Examples

all_CSVs = read.csv.all('directory/*/*.csv')

mbergins/BerginskiRMisc documentation built on Aug. 5, 2022, 4:16 a.m.