For-loop across multiple cells

Hi all! I have a notebook that runs R. In one of the cells I’ve declared a variable as a single text string (e.g. iso3 ← ‘USA’), which I would instead like to change to a list of text strings (e.g. iso3 ← c(‘USA’, ‘Canada’…)). Just as in a for loop, I’d like all the subsequent cells to run for each item in the list. However, I have no idea how to design a for loop that will run across multiple cells. Any suggestions?


This link could be of use.