find_file: Find a File with the Specified Date + Pattern in the File...

find_fileR Documentation

Find a File with the Specified Date + Pattern in the File Name

Description

find_file looks for a file in the folder directory with the date date in its name. It returns the path to that file; if more than one file is found, it returns the path to the first one and issues a warning.

Usage

find_file(
  date = Sys.Date(),
  pattern = paste0(".*", date, ".*"),
  directory = NULL,
  file_name = NULL,
  date_flag = NULL,
  rtn_error = TRUE
)

Arguments

date

A Date indicating the date to look for in the filename (if any)

pattern

The pattern to match when searching for the filename. The default is to look for any file with date in the name.

directory

The directory in which to search for the file.

file_name

If the search does not return a file known to exist, file_name can be used to specify the file directly

date_flag

A string used to print more informative messages in some functions

Value

A string containing the full path to the file that was found


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