tests/testthat/examples/knitr-examples/054-loop-plots.md

We can draw plots in a loop.

for (i in 1:5) {
    cat("\n\nthis is plot ", i, "\n\n")
    plot(1:i)
}

this is plot 1

this is plot 2

this is plot 3

this is plot 4

this is plot 5



Try the parsermd package in your browser

Any scripts or data that you put into this service are public.

parsermd documentation built on Aug. 21, 2025, 5:27 p.m.