get_filepath: Retrieve the path to a single file from the package cache.

View source: R/filecache.R

get_filepathR Documentation

Retrieve the path to a single file from the package cache.

Description

Retrieve the path to a single file from the package cache.

Usage

get_filepath(pkg_info, relative_filename, mustWork = TRUE)

Arguments

pkg_info,

named list. Package identifier, see get_pkg_info() on how to get one.

relative_filename,

string. A filename, relative to the package cache.

mustWork,

logical. Whether an error should be created if the file does not exist.

Value

string. The path to the file. If mustWork=TRUE, the file is guaranteed to exist if the function returns (an error will occur if it does not). If mustWork=FALSE and the file does not exist, the empty string is returned.

Examples

    pkg_info = get_pkg_info("mypackage")
    full_path_of_file = get_filepath(pkg_info, "file1.txt", mustWork=FALSE)


dfsp-spirit/pkgfilecache documentation built on Feb. 6, 2024, 4:51 p.m.