knitHTML和rmarkdown render有什么区别? [英] What is the difference between knitHTML and rmarkdown render?

查看:184
本文介绍了knitHTML和rmarkdown render有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Windows 7上使用RStudio版本0.98.501,R版本3.0.2.我在.Rmd文件中编写了以下代码:

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

当我单击knitHtml按钮时,创建的html文件不包含目录.但是,当我使用以下代码时,它将创建目录并将主题更改为united:

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

有什么区别?如何使knitHtml按钮以代码的方式工作?

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

推荐答案

RStudio 0.98.501版不支持 rmarkdown 软件包.您必须检出最新的预览版本(目前为v0.98.894).

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

这篇关于knitHTML和rmarkdown render有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆