首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在RNotebook中使用常规html_document YAML标记

在RNotebook中使用常规html_document YAML标记
EN

Stack Overflow用户
提问于 2017-08-03 17:44:22
回答 1查看 124关注 0票数 0

作为标题-我希望能够在RNotebook文件中使用像toc: true和toc_float: true这样的YAML标记。目前,我有以下内容:

`

标题:"R Notebook“输出: html_notebook:

toc:true

第1节

这是一台R Markdown笔记本。W

第2节

{r} plot(cars) `

这给出了一个错误: error in yaml::yaml.load(string,...):Scanner :在扫描第3行第1列的下一个标记时发现无法开始第3行第1列的任何标记的字符

将加载文档,但没有toc。

EN

回答 1

Stack Overflow用户

发布于 2017-08-03 19:02:32

尝试rstudio基础示例中的这个示例

代码语言:javascript
复制
---
title: "R Notebook"
output:
  html_notebook:
    toc: yes
    toc_float: yes
  html_document:
    toc: yes
---

# blabla section 1

This is an [R Markdown](http://rmarkdown.rstudio.com) Notebook. When you execute code within the notebook, the results appear beneath the code. 

Try executing this chunk by clicking the *Run* button within the chunk or by placing your cursor inside it and pressing *Ctrl+Shift+Enter*. 

```{r}

plot(汽车)

代码语言:javascript
复制
# blabla section 2

Add a new chunk by clicking the *Insert Chunk* button on the toolbar or by pressing *Ctrl+Alt+I*.

When you save the notebook, an HTML file containing the code and output will be saved alongside it (click the *Preview* button or press *Ctrl+Shift+K* to preview the HTML file).
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45480547

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档