Skip to Main Content
The Library is now open for students, staff, and faculty of The Claremont Colleges. See COVID-19 Services and Updates for more information.

Introduction to R Programming

Why use "for" "if " and other?

With the "for" "if" functions and logic operators, your computer can handle a large amount of data easily, which would be time-consuming if you do it with your hands. The functions introduced in this part are almost identical for every programming languages. If you become very familiar with them, it would be much easier to study any progarmming languages on your own.

1. Use "for" loop to repeat doing something

2. "while" can loop the program under customized conditions

3. If statement chooses to do something or not based on your resctrions

4. Use logic operators to customize your conditions on "for" "while" or "if"

5. Mix all the above 4 functions to make your own program!