我知道这个问题类似于this之一。但我无法在那里找到解决方案,因此再次在此发布。如何在命令行中复制针织HTML?
我想通过点击“编织HTML”,但通过命令获得与我相同的输出。我tryied使用knit2html但它与格式食堂,不包括标题,kable不工作等
例子:
这是我test.Rmd文件,
---
title: "test"
output: html_document
---
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
```{r}
library(knitr,quietly=T)
kable(summary(cars))
```
You can also embed plots, for example:
```{r, echo=FALSE}
plot(cars)
```
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
输出:
针织HTML
knit2html
FWIW我喜欢命令行输出。 – 2014-12-02 10:18:53
@KonradRudolph:它不适合我。这只是我提出的示例代码。我的实际使用案例有一个8列10行的大表格。命令行输出看起来很丑。 – Avinash 2014-12-02 10:20:08
这主要是因为两个选项(!)在默认情况下严格格式化表。查看我的答案以获得改进的选项。 – 2014-12-02 10:35:31