Abstract
R allows you to save and reuse code, as we discussed in Chapter 1. When explicit looping is necessary, it is possible, as you will learn in this chapter. We will discuss the basics of programming in general, and the specifics of programming in R, including program flow, looping, and the use of logic. In Chapter 3, you will learn how to create your own useful R functions to keep from typing the same code repetitively. When you create functions, they are saved in your workspace image, and are available to you whenever you need them. As mentioned earlier, R programming is functional in the sense that each function call should perform a well-defined computation relying on the arguments passed to the function (or to default values for arguments). Everything in R is an object, including a function, and in this sense, R is an object-oriented programming language.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Rights and permissions
Copyright information
© 2012 Larry Pace
About this chapter
Cite this chapter
Pace, L. (2012). Programming in R. In: Beginning R. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-4555-1_2
Download citation
DOI: https://doi.org/10.1007/978-1-4302-4555-1_2
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4302-4554-4
Online ISBN: 978-1-4302-4555-1
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books