CHAPTER 3

image

Writing Reusable Functions

As you learned in the previous chapters, everything in R is an object. This makes R an object-oriented programming language. There are many built-in functions and thousands more contributed by the R community. Before you consider writing your own function for a particular problem, check the R documentation and discussions to see if someone else has already done the work for you. One of the best things about the R community is that new packages appear regularly, and it is quite likely someone else has already faced and solved the same programming problem. If they haven’t, it is easy enough to create your own ...

Get Beginning R: An Introduction to Statistical Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.