# For a loop that would otherwise give no feedback as to where it is up to,
# simply include iteration() anywhere inside the loop to show progress
for(i in 1:10000) {
2 * 2
iteration()
}
# 10
# 20
# 50
# 100
# 200
# 500
# 1,000
# 2,000
# 5,000
# 10,000
# 20,000
# 50,000
# To use an iterator other than 'i' (example: 'page')
for(page in 1:10000) {
2 * 2
iteration("page")
}
# 10
# 20
# 50
# 100
# 200
# 500
# 1,000
# 2,000
# 5,000
# 10,000
# Use custom iteration intervals
for(i in 1:10000) {
2 * 2
iteration(iteration_values = seq(0, 1e4, 1e3))
}
# 1,000
# 2,000
# 3,000
# 4,000
# 5,000
# 6,000
# 7,000
# 8,000
# 9,000
# 10,000
Run the code above in your browser using DataLab