document.addEventListener("DOMContentLoaded", function () { // Create a button to toggle the TOC const button = document.createElement("button"); button.innerText = "Toggle TOC"; button.classList.add("toc-toggle-button"); document.body.appendChild(button); // Add event listener to toggle the TOC visibility button.addEventListener("click", function () { document.body.classList.toggle("show-toc"); }); });

8  Working With Time Series Data in R