4. Control Flow: if/else and for

Learn if/else branching and for loops in R with live, editable code.

if/else branches on a condition; for loops repeat code over a sequence. Loops are common in R, though vectorized code (like Lesson 2) is usually faster and more idiomatic.

Back to top