0

I have a while that generates several graphs and some text after each graph. The code looks like this:

while i<=length(json)
{
ggplot graph
save the ggplot graph to use it like a background image for the next graph
ggplot graph
print(ggplot graph)
text from json
text from json
i=i+1
}

so when I generate the html it first generates the text and then the graphic, from what I've seen it skips print, generates the text and then returns to print

I want it to generate the graphic first and then the text

  • 3
    Welcome to Stack Overflow! It is helpful that you have tried to post a pseudocde outline of what the code is doing but it's going to be hard for anyone to help unless you include some actual code as well - ideally with a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) using a built-in dataset, e.g. `mtcars` or `iris`. It would also be helpful if you are a bit more explicit about the output that is currently being produced, and how this differs from the output that you would like to produce. – SamR Nov 29 '22 at 12:45

0 Answers0