See
?Control
The Control structures are primarily useful for writing programs. In the console, the apply functions (apply, sapply, ..) are most appropriated.