I am implementing a solution to the Traveling Salesman Problem (TSP) in R (simulated Annealing) and I want to output the current best path periodically. I have searched qui
Calling Sys.sleep(0) should cause the plot to draw. Unlike the X11 solution, this will work on server versions of RStudio as well.
Sys.sleep(0)
X11
(I was surprised that dev.flush() did not give the result you were hoping for, that might be a bug.)
dev.flush()