The initial set up of the for loop is made up of two parts. First you define a brand new variable that does not exist yet that will be become every element in the second part of the loop which is a collection of objects, normally a vector
or a list
. You then write code that you want to execute on each object in the vector
in curly braces. All code that comes between the first open curly brace and the last closed corresponding curly brace will be run each time your newly defined variable becomes the next object in the supplied vector.