Skip to Main Content
Library open only to current Claremont Colleges students, faculty, and staff: Tuesday, December 6 - Thursday, December 15.
Exceptions include those visiting Bookstore, Cafe, and Special Collections Appointments. More info on Blackout Dates for Community Access.

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!