Chapter 5. An Overview of the R Language

Learning a computer language is a lot like learning a spoken language (only much simpler). If you’re just visiting a foreign country, you might learn enough phrases to get by without really understanding how the language is structured. Similarly, if you’re just trying to do a couple of simple things with R (like drawing some charts), you can probably learn enough from examples to get by.

However, if you want to learn a new spoken language really well, you have to learn about syntax and grammar: verb conjugation, proper articles, sentence structure, and so on. The same is true with R: if you want to learn how to program effectively in R, you’ll have to learn more about the syntax and grammar.

This chapter gives an overview of the R language, designed to help you understand R code and write your own. I’ll assume that you’ve spent a little time looking at R syntax (maybe from reading Chapter 3). Here’s a quick overview of how R works.

Get R in a Nutshell, 2nd Edition 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.