Learn R Programming

toscutil (version 2.8.0)

find_description_file: Find DESCRIPTION File

Description

Searches for a DESCRIPTION file starting from the current or specified directory and moving upwards through the directory hierarchy until the file is found or the root directory is reached.

Usage

find_description_file(start_dir = getwd())

Value

The path to the DESCRIPTION file if found. If not found, the function stops with an error message.

Arguments

start_dir

The starting directory for the search. Defaults to the current working directory.

Examples

Run this code
# Start search from a specific directory
graphics_pkg_dir <- system.file(package = "graphics")
find_description_file(graphics_pkg_dir)

if (FALSE) {
# Below example will only work if executed from a package directory
find_description_file()
}

Run the code above in your browser using DataLab