locate_file: Locate file from search path

Description Usage Arguments Value Examples

View source: R/new_script.R

Description

Finds first file in search_path that exists

Usage

1
locate_file(x, search_path = c("."), recursive = FALSE)

Arguments

x

string for file name

search_path

vector of strings giving search path

recursive

logical. Default TRUE. whether to do recusive search or not

Value

Path of located file. Returns error if file not found.

Examples

1
2
3
4
## Not run: 
locate_file('script.R',c('.','Scripts')) ## looks in current working directory, then Scripts folder

## End(Not run)

tsahota/tidyproject documentation built on April 19, 2021, 9:15 p.m.