Possible Duplicate:
Plotting during a loop in RStudio
I'm trying to monitor the status of a convergence loop, and I can't seem to get it to update the graph each time it iterates.
Here's some sample code:
print(plot(c(0,1)~c(0,100)))
for(i in seq(100)) {
Sys.sleep(.1)
print(points( runif(1)~i ))
}
Note that the graph only updates after everything's been plotted. I need it to update each loop iteration. I thought print
would do that, but it's not working.
Update
This is an RStudio-specific problem, as it works properly in base R. Is there a way to force graphing in RStudio each loop iteration?