相关疑难解决方法(0)

使用knitr和pandoc转换为PDF时,在markdown中的位置

我正在尝试使用knitr和pandoc转换为PDF时控制绘图的位置.我的.Rmd文件看起来像这样:

# My report

Some text some text some text some text some text some text some text some text some text


```{r myplot, echo=FALSE, fig.pos="placeHere", results='hide'}

library(ggplot2)

ggplot(mtcars, aes(mpg, drat)) + geom_point()

```

Some text some text some text some text some text some text some text some text some text

\usepackage{graphicx}
\begin{figure}[placeHere]
  \centering
    \includegraphics[width=0.5\textwidth]{placeHere}
\end{figure}

Some text some text some text some text some text some text some text some text some text
Run Code Online (Sandbox Code Playgroud)

我正在使用此处提供的功能转换为PDF:http://quantifyingmemory.blogspot.co.uk/2013/02/reproducible-research-with-r-knitr.html

如何在第二和第三块文本之间放置图?乳胶代码目前无法正常工作. …

markdown r pandoc knitr

33
推荐指数
6
解决办法
5万
查看次数

标签 统计

knitr ×1

markdown ×1

pandoc ×1

r ×1