Abstract
In Chapter 3, you saw an example of a simple function for calculating a person’s body mass index (BMI). The function used logic to determine the person’s risk category. The use of logic, conditional statements, and loops are all inherent in controlling the flow of a program. Although there are many different ways to write conditional statements, and loops, too, for that matter, they all boil down to testing to see if some condition is true or false and then behaving accordingly. A program is nothing more or less than a series of instructions telling a computer what to do. As I have mentioned, R is both functional and objected-oriented, so every R program consists of function calls that operate on objects.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2015 Dr. Joshua F. Wiley and the estate of Larry A. Pace
About this chapter
Cite this chapter
Wiley, J.F., Pace, L.A. (2015). Chapter 4: Control Structures. In: Beginning R. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-0373-6_4
Download citation
DOI: https://doi.org/10.1007/978-1-4842-0373-6_4
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-0374-3
Online ISBN: 978-1-4842-0373-6
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books