The most capable format by far is revealjs which can be presented as HTML slides or can be printed to PDF for easier distribution
Quarto Document Structure
YAML Header
The YAML header defines the document metadata, such as title, author, date, and output format.
---title:"Statistical Analysis Presentation"author:"Your Name"date:"2024-11-05"format: revealjs---# IntroductionThis is an example.
Creating HTML Output
Basic YAML Configuration
To generate an HTML file, specify format: revealjs in the YAML header.
Use quarto render in R to generate the output.
Creating Slides
You can also divide slide shows into sections with title slides using a level 1 and level 2 header (#). For example:
---title:"Statistical Analysis Presentation"author:"Your Name"date:"2024-11-05"format: revealjs---# Introduction## Section 1This is an example.
Incremental Lists
This is how we create increamental lists
---title:"Statistical Analysis Presentation"author:"Your Name"date:"2024-11-05"format: revealjsincremental:true---## Section 1- This is an example- This is another example.
Incremental Lists
We can obtain the same output in the following way:
---title:"Statistical Analysis Presentation"author:"Your Name"date:"2024-11-05"format: revealjs---## Section 1:::{.incremental}- This is an example- This is another example.:::
Multiple Columns
To put material in side by side columns, you can use a native div container with class .columns
You may want to highlight specific lines of code output
The following will highlight code 1-4 and 6-11
```{python, filename="Python", echo=TRUE, eval=TRUE}#| code-line-numbers: "1-4|6-11"from collections import Counterimport pandas as pdfrom pretty_html_table import build_tablefrom IPython.display import display, HTML# Input textstexts = { "text_1": "I love playing football.", "text_2": "I hate basketball.", "text_3": "When I was a kid I was playing football."}```
Python
from collections import Counterimport pandas as pdfrom pretty_html_table import build_tablefrom IPython.display import display, HTML# Input textstexts = {"text_1": "I love playing football.","text_2": "I hate basketball.","text_3": "When I was a kid I was playing football."}
Code Blocks in R
You may want to highlight specific lines of code output
The following will highlight code 2,3,4
```{r, filename="R", echo=TRUE, eval=TRUE}#| code-line-numbers: "2|3|4"# Input textstext_1 <- "I love playing football."text_2 <- "I hate basketball."text_3 <- "When I was a kid I was playing football."```
R
# Input textstext_1 <-"I love playing football."text_2 <-"I hate basketball."text_3 <-"When I was a kid I was playing football."
Code Blocks in R
As you might guess:
echo can have two values
TRUE - code is visible
FALSE - code is not visible
eval has two values:
TRUE - code is executed
FALSE - code is not executed
Code Blocks in R
Examples
echo=TRUE
You can see the code and the code is executed automatically.
```{r, filename="R", echo=TRUE}text_1 <- "I love playing football."print(text_1)```
R
text_1 <-"I love playing football."print(text_1)
[1] "I love playing football."
echo=FALSE
You cannot see the code and the code is executed automatically.
```{r, filename="R", echo=FALSE}text_1 <- "I love playing football."print(text_1)```
[1] "I love playing football."
Code Blocks in R
Examples
eval=FALSE
You can see the code and the code is not executed.
```{r, filename="R", echo=TRUE, eval=FALSE}text_1 <- "I love playing football."print(text_1)```
R
text_1 <-"I love playing football."print(text_1)
eval=TRUE
You can see the code and the code is executed.
```{r, filename="R", echo=TRUE, eval=TRUE}text_1 <- "I love playing football."print(text_1)```