10 Doing more with your data with extensions
This chapter covers
- Writing your own packages
- Analyzing your code (benchmarking/profiling)
- Making code more efficient
- Figuring out where to go next
- Communicating your work
If all has gone well, you now have the tools you need to take command of your data and extract insights from it in a reproducible, readable, and understandable way. That’s not the end of the line for learning about R, though. As you gain more experience, you’ll find certain parts that you wish were better. Maybe your code runs too slowly to be useful, maybe you need more rigor in the functions you’ve written, or maybe you’ve made something awesome and want to share it with the world. This chapter covers how to do these things should you decide you want to. There’s a lot to learn, so I’ll cover the basics and hopefully give you enough of a head start to track down the remaining pieces of your particular puzzle.
10.1 Writing your own packages
Whether you have a single function or a whole directory full of files containing functions, it’s often a good idea to solidify these into a package. Not only does this allow some formal testing of your function(s), but it also provides a very good mechanism for documentation, and at the end of it you have something you can more easily share with others.