Exercises
- For the following loop, please answer the questions
arbitrary_vec <- c(-1, 0, 1, -1) for(i in arbitrary_vec){ print(i) }
- What is the final value for
i
? - How many times have i been defined?
- If I re-wrote the code above by replacing
i
withelement
, does the loop behave differently not defining a variablei
?
- What is the final value for