Skip to main content

Testing and Package Checking

  • Chapter
  • First Online:
Beginning Data Science in R
  • 9785 Accesses

Abstract

Without testing, there is little guarantee that your code will work at all. You probably test your code when you write it by calling your functions with a couple of chosen parameters, but to build robust software you need to approach testing more rigorously. And to prevent bugs from creeping into your code over time, you should test often. Ideally, you should check all your code anytime you make any changes to it.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 44.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    I know that a rectangle doesn’t have to have sides parallel with those two dimensions, but there is no need to make the example more complicated than it has to be.

  2. 2.

    If there are, you should have a look at .Rbuildignore. If you have a file just the place you want it but the check is complaining, you can just add the filename to .Rbuildignore and it will stop complaining. If you have a README.Rmd file, for example, it will probably complain, but then you can add a line to .Rbuildignore that says ^README.Rmd$.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2017 Thomas Mailund

About this chapter

Cite this chapter

Mailund, T. (2017). Testing and Package Checking. In: Beginning Data Science in R. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-2671-1_12

Download citation

Publish with us

Policies and ethics