简体   繁体   English

在 R Markdown 中绘制层次结构选项卡

[英]Plot a hierarchy tabs in R Markdown

I have been trying to plot a hierarchy tabs in R markdown but somehow when I knit the document it does not show the tabs.我一直在尝试在 R markdown 中绘制层次结构选项卡,但不知何故,当我编织文档时,它没有显示选项卡。 I was expecting: Score should have Plots and Plots123 as sub tab and Score1 should be aligned with Score tab.我期待:Score 应该有 Plots 和 Plots123 作为子选项卡,Score1 应该与 Score 选项卡对齐。 But my output does not show any tabs.但是我的输出没有显示任何选项卡。 PS: (I have purposely written `` while defining a chunk because Stack overflow interprets '```' as code) PS:(我在定义块时特意写了``因为堆栈溢出将'```'解释为代码)


## Score {.tabset}

### Plots
``
{r pressure, echo=FALSE}
plot(pressure)
``
### Plots123
``{r pressure_1, echo=FALSE}
plot(pressure)
``
## Scores1 {.tabset}
``{r pressure_2, echo=FALSE}
plot(pressure)
``

Here's my version - this seems to work.这是我的版本 - 这似乎有效。 Try this out exactly and let me know.试一试,让我知道。

Forrmarkdown , all sub-headers of the header with the .tabset attribute appear within tabs rather than as standalone sections.对于rmarkdown ,具有.tabset属性的标题的所有子标题都出现在选项卡中,而不是作为独立部分出现。 Also, trying additional spacing between headers.此外,尝试在标题之间增加间距。

---
title: "Test"
author: "Test"
date: "2/29/2020"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

## Score {.tabset}

### Plots
```{r pressure, echo=FALSE}
plot(pressure)
```

### Plots123
```{r pressure_1, echo=FALSE}
plot(pressure)
```

## Scores1 {.tabset}
```{r pressure_2, echo=FALSE}
plot(pressure)
```

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM