I am trying to knit a PDF doc using Markdown and the regression table and one of the graphs are not in the place I wrote then in the rmarkdown file, which makes the report looking out of order. I have tried every solution I could find online but I would either get no results at all or error messages. I would appreciate help that would solve this issue.
I tried adding the following code to the end of every chunk.
knitr::knit_hooks$set(plot = function(x, options) {
paste0(knitr::hook_plot_tex(x, options), "\n\\FloatBarrier\n")
})
I've tried the following at the top of chunks:
knitr::opts_chunk$set(fig.pos = "!H", out.extra = "")
I have also tried setting fig.pos = 'h'
among many other codes with no success at all.