I have a simple loop
for(z in 1:length(x)){
country=region_names[z]
//paste("xyz",country)//
....
}
Now, after the loop is finished, z will have the value equal to the length of x.
Now, I need to find a way to add an iterator.
Supposedly, when it is at the second loop, iterator=2, it will show "xyzUSA".
Supposedly, when it is at the third loop, iterator=3, it will show "xyzFrance"
My problem is, I don't need to show them all at once, but when the iterator is triggered, the program knows what the value of iterator is, and shows the corresponding country.
Now, how can I build an iterator like this?
Any help is appreciated