### Render report
This is the code you can use to render this report. This will automatically rename it with today's date.
Note the `eval: false` which makes sure that rendering this report doesn't run the code to render the report (infinite loop!)
```{r}
#| eval: false
quarto::quarto_render(
  input = "example.qmd", 
  output_file = paste0("example_", Sys.Date(), ".html")
)
```

## Setup
We can use `message: false` to suppress start up package messages (if you like).
```{r}
#| message: false
library(tidyverse)
```

## Data Exploration

```{r}
ggplot(data = mtcars, aes(x = factor(cyl), y = mpg)) +
  theme_bw() +
  geom_violin() +
  geom_point()
```


## Analysis

We can use tabs to organize content!

:::{.panel-tabset}

### Main results
```{r}
m <- lm(mpg ~ factor(cyl), data = mtcars)
summary(m)
```

### Model checks

```{r}
plot(m)
```

:::

## Reproducibility

### Data

Data available for download via CSV/Excel buttons (do not use this as data source, but as confirmation and for posterity)

You can use the HTML `<details><summary></summary></details>` tags to hide content under a button.

<details>
  <summary>Show data</summary>

```{r}
DT::datatable(mtcars, extensions = 'Buttons',
              options = list(dom = 'Bfrtip', buttons = c('csv', 'excel')))
```

</details>

### Packages & Session Info

Make sure you [cite](https://ropensci.org/blog/2021/11/16/how-to-cite-r-and-r-packages/) important packages in your manuscripts.

<details>
  <summary>Show packages</summary>

```{r}
#| results: asis
report::report_packages(prefix = "- ")
report::cite_packages(prefix = "- ")
```


```{r}
devtools::session_info()
```

</details>
