Hour 7. Writing Functions: Part I

What You’ll Learn in This Hour:

Image How to write and use a simple R function

Image How to return objects from a function

Image How to control flow through a function

So far in this book you have seen many functions being used. For example, in the earlier hour on single-mode data structures you saw that you could create vectors using functions such as c, seq, and rep. One of the strengths of R is that you can extend it by writing ...

Get Sams Teach Yourself R in 24 Hours 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.