我在脚本中使用knitr
和markdown
,如下所示:
library(knitr)
library(markdown)
knit("myfile.Rmd", output="out.md")
markdownToHTML("out.md", output="result.html")
最终结果文件“result.html”看起来不错,只是图中的图像没有显示。
在html文件的来源中,图像被称为:
<p><img src="figure/unnamed-chunk-16-1.png" alt="plot of chunk unnamed-chunk-16"/> </p>
并非自足。引用的图像文件不存在。
我在使用R 3.1.2的Linux机器上,所有软件包都是最新的。
我安装了httpuv
和caTools
包,但没有任何更改。
这是一个最小的Rmd文件
---
title: "test"
output: html_document
---
all the packages that I'm loading
```{r}
library(lattice)
library(caret)
library(nnet)
library(pROC)
library(VIM)
```
plot that does not work
```{r}
attach(iris)
xyplot(iris$Sepal.Length~iris$Sepal.Width)
```