What is the difference between knitHTML and rmarkdown render?

社会主义新天地 提交于 2019-12-11 22:09:31

问题


I am using RStudio version 0.98.501, R version 3.0.2 on Windows 7. I have following code written in a .Rmd file:

---
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

When I click knitHtml button the created html file DOES NOT contain the table of contents. However when I use following code, it creates the table of contents and change the theme to united:

rmarkdown::render('C:/Users/durraniu/Documents/Trajectory1/knitHtml/test.Rmd')

What is the difference and how can I make knitHtml button work the way the code does?


回答1:


RStudio version 0.98.501 does not support the rmarkdown package. You have to check out the latest preview version (at this moment, v0.98.894).



来源:https://stackoverflow.com/questions/24083484/what-is-the-difference-between-knithtml-and-rmarkdown-render

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!