R - Flow (Control Structure)

> Procedural Languages > R

1 - About

3 - Type

3.1 - Basic

See

?Control

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

  • if: testing a condition
  • for: execute a loop n number of times
  • while: execute a loop while a condition is true
  • repeat: execute an infinite loop
  • break: break the execution of a loop
  • next: skip an iteration of a loop
  • return: stop the execution of function and return a value
Advertising

3.2 - Others