Book Image

R High Performance Programming

Book Image

R High Performance Programming

Overview of this book

Table of Contents (17 chapters)
R High Performance Programming
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Summary


In this chapter, we learned about the copy-on-modification semantics of R's memory management. A good understanding of how this works enables us to find opportunities to reduce the memory consumption of R programs.

We also saw how temporary variables and intermediate computations can be removed from the environment when they are no longer needed, to free up memory for subsequent computations. Besides removing temporary variables explicitly, we learned two other ways to manage temporary variables automatically. First, on the fly computations produce intermediate data without creating variables that persist in the memory. Second, functions are a useful way to group related operations and automatically remove temporary variables when exiting the functions.

Finally, we saw how to save data to the disk to free up memory and reload them later when needed.

In the next chapter, we will explore more advanced techniques in order to optimize memory consumption and allow R programs to work with...