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.
Examples
# Start search from a specific directory
graphics_pkg_dir <- system.file(package = "graphics")
find_description_file(graphics_pkg_dir)
#> [1] "/opt/R/4.4.1/lib/R/library/graphics/DESCRIPTION"
if (FALSE) { # \dontrun{
# Below example will only work if executed from a package directory
find_description_file()
} # }