find_file: Find a file

Description Usage Arguments Value

View source: R/find_file.R

Description

Locate a file somewhere within the directory structure of an RProject.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
find_file(
  filename,
  search_path = NULL,
  return_all = FALSE,
  duplicated_files_error = FALSE,
  verbose = FALSE,
  directory = FALSE,
  extension = NULL,
  error_if_none = TRUE,
  recursive = TRUE,
  exact_match = FALSE
)

Arguments

filename

Name of the file to search for

search_path

Optional path within which to search

return_all

Return all matches?

duplicated_files_error

Throw an error if more than one matching file found?

verbose

Print messages?

directory

Search for a directory instead of a file?

extension

Search for files with this extension only?

error_if_none

Throw an error if no matches are found? If FALSE, the function returns a NULL value.

recursive

Search recursively?

exact_match

Should does the filename have to match exactly?

Value

The absolute path to the file, if it was found.


michaelfrancenelson/rmd.utils documentation built on Dec. 21, 2021, 5:57 p.m.