In this chapter, you learned the syntax of assignment, conditional expressions, and loops. In the section on assignment, you got to know the naming rules of variables and how to walk around. In the section on conditional expressions, you learned how to use the if
statement as either a statement or an expression, and how ifelse()
is distinct from if
when dealing with vectors. In the section on loops, you learned about the similarities and differences between for
loops and while
loops. Now, we are equipped with the basic expressions to control the logic flow of an R program.
In the next chapter, you will use what you learned in the previous chapters and see what you can do with the basic objects representing data and basic expressions representing our logic. You will learn about basic functions in various categories as the building blocks of data transformation and statistical analysis.