Learn R Programming

toscutil (version 2.8.0)

read_description_file: Read DESCRIPTION File into a List

Description

Reads the DESCRIPTION file of an R package and converts it into a list where each element corresponds to a field in the DESCRIPTION file.

Usage

read_description_file(p = NULL)

Value

A list where each element is a field from the DESCRIPTION file.

Arguments

p

The path to the DESCRIPTION file. If NULL, the function attempts to find the DESCRIPTION file by searching upwards from the current directory.

Examples

Run this code
# Read DECRIPTION file from a specific path
graphics_pkg_dir <- system.file(package = "graphics")
graphics_pkg_descfile <- find_description_file(graphics_pkg_dir)
desc_list <- read_description_file(graphics_pkg_descfile)
str(desc_list)

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

Run the code above in your browser using DataLab