locate_file: Locate file from search path

Description Usage Arguments Value Examples

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)

Ollegst/MSDproject documentation built on May 23, 2019, 9:37 a.m.