The output of the code that I include at the end is taken from the 1st section of
https://www.r-bloggers.com/2022/09/r-markdown-lesser-known-tips-tricks-4-looks-better-works-better/
The reproduced page appears in the referred link with buttons to hide/show the code that are labeled “code”.
Surprinsingly, when I knit to html the same code myself, the button at the top right of the chunk is labeled “Show” (instead of “Code”), which I am finding that is inconvenient for other people reading my work: they are just unaware that the code is actually there.
How could I get the text of both buttons to be “Code” as in the example (or even better “Show Code”)?
Output reproduced in the web page:
But my own output with the same code is:
The example code is
---
title: "Code Collapse Demonstration"
output:
html_document:
code_folding: hide
---
```{r}
#| include = FALSE
library(dplyr)
library(ggplot2)
There is a negative correlation between horsepower and miles per gallon.
mtcars %>%
ggplot(aes(x = hp, y = mpg)) +
geom_point()