We will use R for our data analysis so we need to know the basics of programming in the R language. R is a full programming language with both functional programming and object oriented programming features. Learning the language is far beyond the scope of this chapter and is something we return to later. The good news, though, is that to use R for data analysis, you rarely need to do much programming. At least, if you do the right kind of programming, you won’t need much.
For manipulating data—and how to do this is the topic of the next chapter—you mainly just have to string together a ...