externalFile: Locate External File Across Different Paths

View source: R/utilsFiles.R

externalFileR Documentation

Locate External File Across Different Paths

Description

This function takes an external file name and searches for its existence across different possible locations. It first checks the current working directory, then the package's "extdata" directory, and finally a relative "inst/extdata" path. Stop script with an error if the file cannot be found in any of the locations.

Usage

externalFile(extfile)

Arguments

extfile

Character. The name of the external file to locate.

Value

Character. The path of the located external file.

See Also

file.exists, system.file

Examples

## Not run: 
externalFile("data.csv")  # Searches for "data.csv" in various locations

## End(Not run)


Epiconcept-Paris/STRAP-epiuf documentation built on Aug. 5, 2024, 3:41 a.m.