Adding a counter for the position of a record in a R dataframe in a “for” loop
I have some code that runs a sports league table standings simulation, using a “for” loop in R. For each iteration of the loop, a table of standings (i.e. a dataframe) df
is produced like this: