Building Objects and Packages for Code Reuse

In this final chapter, we'll take a look at taking our code out of our own machines and sharing it with the world. The person we'll share with most often will be ourselves! So, with a view to making our own programming lives easier and more streamlined, we'll look at how to create objects and classes to simplify our own workflows and how to bundle them into packages for reuse in other projects. We'll look at tools for sharing code on sites such as GitHub and how to check that everything in your code works the way it is supposed to.

The following recipes will be covered in this chapter:

  • Creating simple S3 objects to simplify code
  • Taking advantage of generic object functions with S3 classes
  • Creating structured and formal objects with the S4 system
  • Simple ways to package code for sharing and reuse
  • Using devtools to host code from GitHub
  • Building a unit test suite to ensure that functions work as you intend
  • Using continuous integration with Travis to keep code tested and up to date
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.250.168