R is a programming language which is mainly used for statistical work. We can use for loops in R in different ways. We can use R for loop with the vector data type and in a regular way like other programming languages too. Syntax The syntax of the for loop is like below.
for (VAL in SEQUENCE)
VAL is used in each iteration to set current element value. SEQUENCE is the list, an array...