Search code examples
htmlrmarkdownr-markdowntableofcontents

R Markdown is not rendering Table of Contents or Tabsets


Trying to format an html document in R markdown with a table of contents and tabsets under certain headers. Using the cheatsheet, a book, and online sources, I think it should be set correctly. However it seems to not render correctly

I have tried to do one at a time and neither works. I have even copied code exactly and rendered and it doesn't show up the same.

I have reinstalled knitr and rmarkdown packages to no avail.

I am running R 5.35.1

---
title: Water Conditions and Operations
date: "`r Sys.Date()`"
output: 
  html_document:
    toc: true
    toc_depth: 3
    toc_float: 
      collapsed: true
      smooth_scroll: true 
---


```{r}
```

## Kings River   

<center>
Insert Image
</center>


### Pine Flat {.tabset}    



#### Daily  

hi  

#### Weekly  

hi  

#### Monthly  

hi  

### Upstream {.tabset}  

#### Daily

#### Weekly

#### Monthly

## State Water Project 

### Precipitation

### Snow

```{r}

```


[Kings River]

I expect there to be a tabset like on how I did on a shiny app. But these just appear as normal headers


Solution

  • Fixed the problem:

    • Uninstalled R
    • Uninstalled R Studio
    • Deleted all Program File Directories for these programs
    • Installed the newest version of R and R Studio

    Knitted to html and it worked