The R Chunk fig.pos option does not take effect when creating a PDF.

I want to apply the parameter fig.pos = 'h' chunk like this:

```{r echo=FALSE , fig.pos='h'}
ggplot() 
```

so when I knit in pdf latex, it positions my graphs (float) in the exact place in the LaTeX code. As far as I understand, this should make my latex code look like:

\begin{figure}[h]
\centering
\includegraphics{files/figure-latex/unnamed-chunk-3-1.pdf}
\end{figure}

but instead, when I open the generated Tex document, I see:

\begin{figure}[htbp]
\centering
\includegraphics{files/figure-latex/unnamed-chunk-3-1.pdf}
\end{figure}

I end my stories in random positions in a PDF instead of where they are in the latex code, sometimes taking up a whole page for one story. I tried fig.pos = 'h', fig.pos = 'H', fig.pos = 'h', fig.pos = 'h!' And fig.pos = 'H! based on the table of this page .

, : fig.pos: (''; character) , \begin {figure} [fig.pos]

, , Rmd ?

+4

All Articles