http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-2.xsd
organize, test, document, and share your code
Turn your R code into packages that others can easily install and use. With this fully updated edition, developers and data scientists will learn how to bundle reusable R functions, sample data, and documentation together by applying the package development philosophy used by the team that maintains the "tidyverse" suite of packages. In the process, you'll learn how to automate common development tasks using a set of R packages, including devtools, usethis, testthat, and roxygen2. Authors Hadley Wickham and Jennifer Bryan from Posit (formerly known as RStudio) help you create packages quickly, then teach you how to get better over time. You'll be able to focus on what you want your package to do as you progressively develop greater mastery of the structure of a package. With this book, you will: Learn the key components of an R package, including code, documentation, and tests Streamline your development process with devtools and the RStudio IDE Get tips on effective habits such as organizing functions into files Get caught up on important new features in the devtools ecosystem Learn about the art and science of unit testing, using features in the third edition of testthat Turn your existing documentation into a beautiful and user friendly website with pkgdown Gain an appreciation of the benefits of modern code hosting platforms, such as GitHub.
Intro -- Copyright -- Table of Contents -- Preface -- Welcome! -- Introduction -- Philosophy -- In This Book -- What's Not Here -- Conventions Used in This Book -- Colophon -- O'Reilly Online Learning -- How to Contact Us -- Acknowledgments -- Part I. Getting Started -- Chapter 1. The Whole Game -- Load devtools and Friends -- Toy Package: regexcite -- Preview the Finished Product -- create_package() -- use_git() -- Write the First Function -- use_r() -- load_all() -- Commit strsplit1() -- check() -- Edit DESCRIPTION -- use_mit_license() -- document() -- NAMESPACE Changes -- check() Again
Install() -- use_testthat() -- use_package() -- use_github() -- use_readme_rmd() -- The End: check() and install() -- Review -- Chapter 2. System Setup -- devtools, usethis, and You -- Personal Startup Configuration -- R Build Toolchain -- Windows -- macOS -- Linux -- Verify System Prep -- Chapter 3. Package Structure and State -- Package States -- Source Package -- Bundled Package -- .Rbuildignore -- Binary Package -- Installed Package -- In-Memory Package -- Package Libraries -- Chapter 4. Fundamental Development Workflows -- Create a Package -- Survey the Existing Landscape
Name Your Package -- Package Creation -- Where Should You create_package()? -- RStudio Projects -- Benefits of RStudio Projects -- How to Get an RStudio Project -- What Makes an RStudio Project? -- How to Launch an RStudio Project -- RStudio Project Versus Active usethis Project -- Working Directory and Filepath Discipline -- Test Drive with load_all() -- Benefits of load_all() -- Other Ways to Call load_all() -- check() and R CMD check -- Workflow -- Background on R CMD check -- Chapter 5. The Package Within -- Alfa: A Script That Works -- Bravo: A Better Script That Works
Charlie: A Separate File for Helper Functions -- Delta: A Failed Attempt at Making a Package -- Echo: A Working Package -- Foxtrot: Build Time Versus Run Time -- Golf: Side Effects -- Concluding Thoughts -- Script Versus Package -- Finding the Package Within -- Package Code Is Different -- Part II. Package Components -- Chapter 6. R Code -- Organize Functions Into Files -- Fast Feedback via load_all() -- Code Style -- Understand When Code Is Executed -- Example: A Path Returned by system.file() -- Example: Available Colors -- Example: Aliasing a Function -- Respect the R Landscape
Manage State with withr -- Restore State with base::on.exit() -- Isolate Side Effects -- When You Do Need Side Effects -- Constant Health Checks -- Chapter 7. Data -- Exported Data -- Preserve the Origin Story of Package Data -- Documenting Datasets -- Non-ASCII Characters in Data -- Internal Data -- Raw Data File -- Filepaths -- pkg_example() Path Helpers -- Internal State -- Persistent User Data -- Chapter 8. Other Components -- Other Directories -- Installed Files -- Package Citation -- Configuration Tools -- Part III. Package Metadata -- Chapter 9. DESCRIPTION -- The DESCRIPTION File
Description based upon print version of record.
Title and Description: What Does Your Package Do?
Sebastopol : O'Reilly Media, Incorporated,c2023