Skip to Content
R Packages, 2nd Edition
book

R Packages, 2nd Edition

by Hadley Wickham, Jennifer Bryan
June 2023
Intermediate to advanced content levelIntermediate to advanced
381 pages
9h 2m
English
O'Reilly Media, Inc.
Content preview from R Packages, 2nd Edition

Chapter 9. DESCRIPTION

DESCRIPTION and NAMESPACE are two important files that provide metadata about your package. The DESCRIPTION file provides overall metadata about the package, such as the package name and which other packages it depends on. The NAMESPACE file specifies which functions your package makes available for others to use and, optionally, imports functions from other packages.

In this chapter, you’ll learn about the most important fields found in DESCRIPTION. The next two chapters cover the topic of package dependencies, which is where the importance of the NAMESPACE file will become clear. First, in Chapter 10, we discuss the costs and benefits of dependencies and also provide the relevant technical context around how R finds objects. In Chapter 11, we explain the practical moves necessary to use your dependencies within your package. The metadata part of the book concludes with Chapter 12, which covers licensing.

The DESCRIPTION File

The job of the DESCRIPTION file is to store important metadata about your package. When you first start writing packages, you’ll mostly use this metadata to record what packages are needed to run your package. However, as time goes by, other aspects of the metadata file will become useful to you, such as revealing what your package does (via the Title and DESCRIPTION) and whom to contact (you!) if there are any problems.

Every package must have a DESCRIPTION. In fact, it’s the defining feature of a package (RStudio and devtools consider ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

R Packages

R Packages

Hadley Wickham
R Cookbook, 2nd Edition

R Cookbook, 2nd Edition

JD Long, Paul Teetor
Advanced R

Advanced R

Hadley Wickham

Publisher Resources

ISBN: 9781098134938Errata Page