Using loops to print output into Knitr

后端 未结 1 1308
死守一世寂寞
死守一世寂寞 2021-01-25 17:16

Apologies for this question - I\'m sure the answer is v simple

I have a couple of lists containing objects. I\'m running them into HTML through knitr and want to contro

1条回答
  •  失恋的感觉
    2021-01-25 17:42

    You should Adding a plot.new before/after calling the plot command to not plot in the same place and call print to force the display when you call it.

    Try this for example:

    lapply(1:4, function(i){
      print(my.list1[[i]])
      plot(my.list1[[i]])
      plot.new()
      print(my.list2[[i]])
      plot(my.list2[[i]])
      plot.new()
      })
    

    0 讨论(0)
提交回复
热议问题