3.7 More to Learn

By now we have have:

  • learned about vectors, an important data structure in R;
  • met quite a few R functions that help us manipulate vectors and print things to the console;
  • learned how to write functions so that we can re-use solutions to problems.

But still it seems that—unless we can find a clever way to exploit vectorization—R isn’t doing anything very impressive, really. In order to unlock the true powers of R (or any programming language, for that matter) we have to acquire more control over what expressions R will evaluate, how many times it will evaluate them, and under what conditions it will do so. This is the domain of flow control, the subject of our next chapter.