Which of the following can be used to loop through a vector in R?
a) for loop
b) while loop
c) repeat loop
d) All of the above
Answer:
d) All of the above
Explanation:
All types of loops (for, while, and repeat) can be used to iterate through a vector in R, depending on the use case.