load_data: Load a Data File Using the Directory, Date, and Extension

View source: R/load_generic.R

load_dataR Documentation

Load a Data File Using the Directory, Date, and Extension

Description

load_data is meant to find and load a delimited or Excel data file given the directory that it's in, the date used in the file name, and the file extension. It is essentially a wrapper around find_file and read_file.

Usage

load_data(
  date = NULL,
  directory,
  file_name = NULL,
  ext = c("csv", "xlsx"),
  pattern = paste0(".*", date, ".*", ext[[1]])
)

Arguments

date

The Date to look for in the file name

directory

The directory to search in using find_file

file_name

Optionally, the name of the file to load; this is useful if searching for non-standard files

ext

The extension of the file to load

pattern

A regular expression combining directory, date, ext, and (possibly) other pieces of the file to load

Value

A tibble containing the loaded data


jesse-smith/coviData documentation built on Jan. 14, 2023, 11:08 a.m.