Title is a one line description of the package, and is often shown in a package listing.The title and description fields describe what the package does. 10.2 Title and Description: What does your package do? This chapter shows you how to use the most important DESCRIPTION fields. If you ever need to work with a DESCRIPTION file programmatically, take a look at the desc package, which usethis uses heavily under-the-hood. The second and subsequent lines should be indented, usually with four spaces. This minimal DESCRIPTION will vary a bit depending on your settings, but should look something like this:ĭescription : The description of a package usually spans multiple lines. This will allow you to start writing the package without having to worry about the metadata until you need to. To get you started, usethis::create_package("mypackage") automatically adds a bare-bones DESCRIPTION file. In fact, it’s the defining feature of a package (RStudio and devtools consider any directory containing DESCRIPTION to be a package) 1. 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.Įvery package must have a DESCRIPTION. When you first start writing packages, you’ll mostly use these metadata to record what packages are needed to run your package. The job of the DESCRIPTION file is to store important metadata about your package. The metadata part of the book concludes with Chapter 13, which covers licensing. In Chapter 12, we explain the practical moves necessary to use your dependencies within your package. First, in Chapter 11, we discuss the costs and benefits of dependencies and also provide the relevant technical context around how R finds objects. The next two chapters cover the topic of package dependencies, which is where the importance of the NAMESPACE file will become clear. In this chapter, you’ll learn about the most important fields found in DESCRIPTION. The NAMESPACE file specifies which functions your package makes available for others to use and, optionally, imports functions from other packages. The DESCRIPTION file provides overall metadata about the package, such as the package name and which other packages it depends on. DESCRIPTION and NAMESPACE are two important files that provide metadata about your package.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |