In This Chapter
Using functions and arguments
Making code clear and legible
Extending R with user packages
Before you start discovering the different ways you can use R on your data, you need to know a few more fundamental things about R.
In Chapter 2, we show you how to use the command line and work with the global environment, so if you read that chapter, you can write a simple script and use the print(), paste(), and readline() functions — at least in the most basic way. But functions in R are more complex than that, so in this chapter we tell you how to get the most out of your functions.
As you add more arguments to your functions and more functions to your scripts, those scripts can become pretty complex. To keep your code clear — and yourself sane — you can follow the basic organizational principles we cover in this chapter.
Finally, much of R allows you to use other people’s code very easily. You can extend R with packages that have been contributed to the R community by hundreds of developers. In this chapter, we tell you where you can find these packages and how you can use them in R.
Functions form the ...