in Technology by (1.9m points)

What does the following code denote about index updation?

for (index in 1:3) {
index <- index * 2

1 Answer

0 votes
by (1.9m points)
In a for-loop the index is updated at the beginning of each iteration. Therefore, reassigning the index symbol during one iteration doesn’t affect the following iterations.