Язык программирования R/Управляющие структуры: различия между версиями

Содержимое удалено Содержимое добавлено
Loops
Циклы "for"
Строка 45:
[1] 5
</pre>
 
=== Циклы с предусловием ("while") ===
When it is not possible to use the for statement, you can also use break or while by specifying a breaking rules. One should be careful with this kind of loops since if the breaking rules is misspecified the loop will never end.
In the two examples below the standard normal distribution is drawn in as long as the value is lower than 1. The cat() function is used to display the present value on screen.