【发布时间】:2014-06-06 13:51:34
【问题描述】:
我在 Windows 7 上使用 RStudio 版本 0.98.501、R 版本 3.0.2。我在 .Rmd 文件中编写了以下代码:
---
title: "Sample Document"
output:
html_document:
toc: true
theme: united
---
Title
========================================================
This is an R Markdown document. Markdown is a simple formatting syntax for authoring web pages (click the **Help** toolbar button for more details on using R Markdown).
When you click the **Knit HTML** button a web page 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}
summary(cars)
```
You can also embed plots, for example:
```{r fig.width=7, fig.height=6}
plot(cars)
```
Literature Review
==================
this is sample text
Hello
------
World!
### Subsection
this is subsection
当我单击knitHtml 按钮时,创建的 html 文件不包含目录。但是,当我使用以下代码时,它会创建目录并将主题更改为united:
rmarkdown::render('C:/Users/durraniu/Documents/Trajectory1/knitHtml/test.Rmd')
有什么区别以及如何使 knitHtml 按钮按照代码的方式工作?
【问题讨论】:
标签: knitr rstudio r-markdown