Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learning R Programming

You're reading from  Learning R Programming

Product type Book
Published in Oct 2016
Publisher Packt
ISBN-13 9781785889776
Pages 582 pages
Edition 1st Edition
Languages
Author (1):
Kun Ren Kun Ren
Profile icon Kun Ren

Table of Contents (21) Chapters

Learning R Programming
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
1. Quick Start 2. Basic Objects 3. Managing Your Workspace 4. Basic Expressions 5. Working with Basic Objects 6. Working with Strings 7. Working with Data 8. Inside R 9. Metaprogramming 10. Object-Oriented Programming 11. Working with Databases 12. Data Manipulation 13. High-Performance Computing 14. Web Scraping 15. Boosting Productivity

Computing on language


In the previous section, we introduced the functional programming facilities in R. You learned that functions are just another type of object we can pass around. When we create a new function, say fun, the environment we create will be associated with the function. This environment is called the enclosing environment of the function, which can be accessed via environment(fun). Each time we call the function, a new executing environment that contains the unevaluated arguments (promises) will be created to host the execution of the function, which enables lazy evaluation. The parent of the executing environment is the enclosing environment of the function, which enables lexical scoping.

Functional programming allows us to write code in higher level of abstraction. Metaprogramming goes even further. It allows us to tweak the language itself and make certain language constructs easier to use in a certain scenario. Some popular R packages use metaprogramming in their functions...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}