class: center, middle, inverse, title-slide .title[ # Quarto ] .author[ ### Visualizing and communicating data with R
The R Bootcamp @ Bern
] .date[ ### June 2024 ] --- layout: true <div class="my-footer"> <span style="text-align:center"> <span> <img src="https://raw.githubusercontent.com/therbootcamp/therbootcamp.github.io/master/_sessions/_image/by-sa.png" height=14 style="vertical-align: middle"/> </span> <a href="https://therbootcamp.github.io/"> <span style="padding-left:82px"> <font color="#7E7E7E"> https://therbootcamp.github.io </font> </span> </a> <a href="https://therbootcamp.github.io/"> <font color="#7E7E7E"> The R Bootcamp | June 2024 </font> </a> </span> </div> --- # What is Quarto? .pull-left4[ <ul> <li class="m1"><span>Open-source scientific and technical <high>publishing system</high>.<br><br> <li class="m2"><span>Simple <high>syntax for formatting</high> documents.</span></li> <ul> <li><span>create <high>dynamic, reproducible content</high> with R, Python, Julia ...</span></li> <li><span>publish to <high>different output formats</high> (articles, presentations, dashboards, websites, books)</span></li> <li><span>write using <high>simple (R)Markdown</high></span></li> </ul> </ul> ] .pull-right5[ <br> <p align = "center"> <img src="image/quarto.png" width=400px><br> <font style="font-size:10px">from <a href="https://quarto.org">quarto.org</a></font> </p> ] --- # What is Markdown? .pull-left4[ <ul> <li class="m1"><span>Developed by John Gruber and Aaron Swartz in 2004.<br><br> "<high>easy-to-read</high> and <high>easy-to-write</high> plain text format, [...] convert it to structurally valid XHTML (or HTML)"</span></li> <li class="m2"><span>Simple <high>syntax for formatting</high> documents.</span></li> <ul> <li><span>highlight text with bold and italic</span></li> <li><span>lists</span></li> <li><span>headers</span></li> <li><span>hyperlinks</span></li> <li><span>images</span></li> </ul> </ul> ] .pull-right5[ <br> <p align = "center"> <img src="image/markdown.png" width=400px><br> <font style="font-size:10px">from <a href="https://de.wikipedia.org/wiki/Markdown">wikipedia.org</a></font> </p> ] --- # What is R Markdown? .pull-left4[ <ul> <li class="m1"><span>Uses Markdown for <high>formatting dynamic reports</high> that include ...</span></li><br> <ul> <li><span><high>R code chunks</high></span></li> <li><span><high>R inline Code</high></span></li> <li><span><high>Visualizations</high></span></li> <li><span>Statistical outputs</span></li> <li><span>Tables</span></li> <li><span>etc.</span></li> </ul> </ul> ] .pull-right5[ <p align = "center"> <img src="image/hex.png" height=300><br> <font style="font-size:10px">from <a href="https://rmarkdown.rstudio.com/docs/">rmarkdown.rstudio.com</a></font> </p> ] --- # R Markdown elements .pull-left4[ <ul> <li class="m1"><span>RMarkdown scripts consist of several <high>elements</high>.</span></li> </ul> <table style="cellspacing:0; cellpadding:0; border:none; padding-top:10px" width=100%> <col width="40%"> <col width="60%"> <tr> <td bgcolor="white"> <b>Element</b> </td> <td bgcolor="white"> <b>Description</b> </td> </tr> <tr> <td bgcolor="white"> <mono>YAML</mono> </td> <td bgcolor="white"> <b>Y</b>AML <b>A</b>in't <b>M</b>arkup <b>L</b>anguage<br> <high>general document settings</high> </td> </tr> <tr> <td bgcolor="white"> <mono>Initial chunk</mono> </td> <td bgcolor="white"> load <high>packages</high><br> load <high>data</high> </td> </tr> <tr> <td bgcolor="white"> <mono>Markdown</mono> </td> <td bgcolor="white"> <high>header</high><br> <high>text</high> highlighting </td> </tr> <tr> <td bgcolor="white"> <mono>Code chunk</mono> </td> <td bgcolor="white"> R <high>Code</high><br> R <high>Outputs<high> </td> </tr> </table> ] .pull-right5[ <p align = "center"> <img src="image/base_quarto_header.png" height=400px> </p> ] --- # Pipeline .pull-left4[ <ul> <li class="m1"><span>Quarto (.qmd) files are translated (rendered) into different <high>document types</high>.</span></li><br> <ul> <li><span>HTML</span></li> <li><span>Word</span></li> <li><span>PowerPoint</span></li> <li><span>PDF</span></li> </ul><br> <li class="m2"><span>To this end, <high>several translation steps</high> are necessary.</span></li><br> </ul> ] .pull-right5[ <br><br><br><br> <p align = "center"> <img src="image/pipeline.png" width=800px><br> <font style="font-size:10px">from <a href="https://quarto.org">quarto.org</a></font> </p> ] --- # Rendering your file .pull-left4[ <high>Rendering</high> (translating) your .qmd file into the <high>final document type</high>: <ul> <li class="m1"><span>Using the <high>Render-button</high> in RStudio.</span></li> <li class="m2"><span>Selecting <high>'Render on save'</high> - rendering will automatically be executed once you save your file.</span></li> <li class="m3"><span>In the <high>Terminal</high>.</span></li> <li class="m4"><span>On the <high>R console</high>.</span></li> </ul> ] .pull-right5[ <p align = "center"> <img src="image/render.png"> </p> ] --- # HTML Pipeline .pull-left4[ <ul> <li class="m1"><span>HTML is a <high>universal framework</high> for documents, presentations, websites and dashboards</span></li> <li class="m2"><span>HTML <high>export to PDF</high> is often straightforward.</span></li><br> </ul> ] .pull-right5[ <p align = "center"> <img src="image/pipeline2.png"> </p> ] --- # HTML .pull-left3[ <ul> <li class="m1"><span><b>H</b>yper<b>T</b>ext <b>M</b>arkup <b>L</b>anguage.</span></li> <li class="m2"><span>The format of the <high>World Wide Web</high>s.</span></li> <li class="m3"><span>Affords flexible styling through <high>CSS</high> (Cascading Style Sheets).</span></li> </ul> ] .pull-right6[ <br> <p align = "center"> <img src="image/markdown_templ_html.png"> </p> ] --- # Displaying HTML .pull-left3[ <ul> <li class="m1"><span>HTML gets <high>interpreted</high> in RStudio (or browsers) so that a well-formatted document emerges.</span></li> <li class="m2"><span><high>Rstudio</high> also shows rendered documents (rather than the raw html). </span></li><br> </ul> ] .pull-right6[ <br> <p align = "center"> <img src="image/markdown_trans.png"> </p> ] --- # Headers .pull-left3[ <ul> <li class="m1"><span>Headers on different <high>levels</high> can be set using <mono>#</mono>.</span></li> </ul> <table style="cellspacing:0; cellpadding:0; border:none; padding-top:20px" width=100%> <col width="40%"> <col width="60%"> <tr> <td bgcolor="white"> <b>Markdown</b> </td> <td bgcolor="white"> <b>Description</b> </td> </tr> <tr> <td bgcolor="white"> <mono># text</mono> </td> <td bgcolor="white"> level 1 </td> </tr> <tr> <td bgcolor="white"> <mono>## text</mono> </td> <td bgcolor="white"> level 2 </td> </tr> <tr> <td bgcolor="white"> <mono>...</mono> </td> <td bgcolor="white"> ... </td> </tr> <tr> <td bgcolor="white"> <mono>##### txt</mono> </td> <td bgcolor="white"> level 5 </td> </tr> </table> ] .pull-right6[ <br> <p align = "center"> <img src="image/markdown_trans_2.png"> </p> ] --- # Headers .pull-left3[ <ul> <li class="m1"><span>Headers on different <high>levels</high> can be set using <mono>#</mono>.</span></li> </ul> <table style="cellspacing:0; cellpadding:0; border:none; padding-top:20px" width=100%> <col width="40%"> <col width="60%"> <tr> <td bgcolor="white"> <b>Markdown</b> </td> <td bgcolor="white"> <b>Description</b> </td> </tr> <tr> <td bgcolor="white"> <mono># text</mono> </td> <td bgcolor="white"> level 1 </td> </tr> <tr> <td bgcolor="white"> <mono>## text</mono> </td> <td bgcolor="white"> level 2 </td> </tr> <tr> <td bgcolor="white"> <mono>...</mono> </td> <td bgcolor="white"> ... </td> </tr> <tr> <td bgcolor="white"> <mono>##### txt</mono> </td> <td bgcolor="white"> level 5 </td> </tr> </table> ] .pull-right6[ <br> <p align = "center"> <img src="image/markdown_trans_3.png"> </p> ] --- # Highlighting .pull-left3[ <ul> <li class="m1"><span>Various operators enable <high>text- and code</high> highlighting.</span></li> </ul> <table style="cellspacing:0; cellpadding:0; border:none; padding-top:20px" width=100%> <col width="50%"> <col width="50%"> <tr> <td bgcolor="white"> <b>Markdown</b> </td> <td bgcolor="white"> <b>Description</b> </td> </tr> <tr> <td bgcolor="white"> *<mono>text</mono>* </td> <td bgcolor="white"> italic </td> </tr> <tr> <td bgcolor="white"> **<mono>text</mono>** </td> <td bgcolor="white"> bold </td> </tr> <tr> <td bgcolor="white"> ***<mono>text</mono>*** </td> <td bgcolor="white"> italic and bold </td> </tr> <tr> <td bgcolor="white"> `<mono>text</mono>` </td> <td bgcolor="white"> code </td> </tr> <tr> <td bgcolor="white"> `<mono>r "text"</mono>` </td> <td bgcolor="white"> inline code </td> </tr> </table> ] .pull-right6[ <br> <p align = "center"> <img src="image/markdown_trans_5.png"> </p> ] --- # Highlighting .pull-left3[ <ul> <li class="m1"><span>Various operators enable <high>text- and code</high> highlighting.</span></li> </ul> <table style="cellspacing:0; cellpadding:0; border:none; padding-top:20px" width=100%> <col width="50%"> <col width="50%"> <tr> <td bgcolor="white"> <b>Markdown</b> </td> <td bgcolor="white"> <b>Description</b> </td> </tr> <tr> <td bgcolor="white"> *<mono>text</mono>* </td> <td bgcolor="white"> italic </td> </tr> <tr> <td bgcolor="white"> **<mono>text</mono>** </td> <td bgcolor="white"> bold </td> </tr> <tr> <td bgcolor="white"> ***<mono>text</mono>*** </td> <td bgcolor="white"> italic and bold </td> </tr> <tr> <td bgcolor="white"> `<mono>text</mono>` </td> <td bgcolor="white"> code </td> </tr> <tr> <td bgcolor="white"> `<mono>r "text"</mono>` </td> <td bgcolor="white"> inline code </td> </tr> </table> ] .pull-right6[ <br> <p align = "center"> <img src="image/markdown_trans_4.png"> </p> ] --- # Highlighting .pull-left3[ <ul> <li class="m1"><span>Various operators enable <high>text- and code</high> highlighting.</span></li> </ul> <table style="cellspacing:0; cellpadding:0; border:none; padding-top:20px" width=100%> <col width="50%"> <col width="50%"> <tr> <td bgcolor="white"> <b>Markdown</b> </td> <td bgcolor="white"> <b>Description</b> </td> </tr> <tr> <td bgcolor="white"> *<mono>text</mono>* </td> <td bgcolor="white"> italic </td> </tr> <tr> <td bgcolor="white"> **<mono>text</mono>** </td> <td bgcolor="white"> bold </td> </tr> <tr> <td bgcolor="white"> ***<mono>text</mono>*** </td> <td bgcolor="white"> italic and bold </td> </tr> <tr> <td bgcolor="white"> `<mono>text</mono>` </td> <td bgcolor="white"> code </td> </tr> <tr> <td bgcolor="white"> `<mono>r "text"</mono>` </td> <td bgcolor="white"> inline code </td> </tr> </table> ] .pull-right6[ <br> <p align = "center"> <img src="image/markdown_trans_6.png"> </p> ] --- # Inline code .pull-left3[ <ul> <li class="m1"><span><high>Numbers or labels</high> in text can be parameterized using inline code.</span></li> <li class="m2"><span>Inline code can include <high>any</high> type/length of R code.</span></li> </ul> ] .pull-right6[ <br> <p align = "center"> <img src="image/markdown_trans_7.png"> </p> ] --- # Chunks .pull-left3[ <ul> <li class="m1"><span>A <high>code chunk</high> can contain any R code.</span></li> <li class="m2"><span>The behavior of code chunks can be controlled using <high>chunk arguments</high>.</span></li> <li class="m3"><span>Add a new chunk with: <mono>Cmd+Shift+I (Mac) Strg+Shift+I (Windows)</mono>.</span></li> </ul> ] .pull-right6[ <br> <p align = "center"> <img src="image/markdown_trans_8_0.png"> </p> ] --- # Chunks .pull-left3[ <table style="cellspacing:0; cellpadding:0; border:none; padding-top:60px" width=100%> <col width="60%"> <col width="40%"> <tr> <td bgcolor="white"> <b>Argument</b> </td> <td bgcolor="white"> <b>Description</b> </td> </tr> <tr> <td bgcolor="white"> <mono>echo=T/F</mono> </td> <td bgcolor="white"> Show/hide <high>code</high>. </td> </tr> <tr> <td bgcolor="white"> <mono>eval=T/F</mono> </td> <td bgcolor="white"> Run/not-run <high>code</high>. </td> </tr> <tr> <td bgcolor="white"> <mono>include=T/F</mono> </td> <td bgcolor="white"> Include/exclude all <high>output</high>. </td> </tr> <tr> <td bgcolor="white"> <mono>message=T/F</mono> </td> <td bgcolor="white"> Include/exclude <highm>messages</highm> in output. </td> </tr> <tr> <td bgcolor="white"> <mono>warning=T/F</mono> </td> <td bgcolor="white"> Include/exclude <highm>warnings</highm>. </td> </tr> </table> <p align="center" style="font-size:12px;padding-top:10px"><mono>T/F = TRUE/FALSE</mono></p> ] .pull-right6[ <br> <p align = "center"> <img src="image/echo_false.png"> </p> ] --- # Chunks .pull-left3[ <table style="cellspacing:0; cellpadding:0; border:none; padding-top:60px" width=100%> <col width="60%"> <col width="40%"> <tr> <td bgcolor="white"> <b>Argument</b> </td> <td bgcolor="white"> <b>Description</b> </td> </tr> <tr> <td bgcolor="white"> <mono>echo=T/F</mono> </td> <td bgcolor="white"> Show/hide <high>code</high>. </td> </tr> <tr> <td bgcolor="white"> <mono>eval=T/F</mono> </td> <td bgcolor="white"> Run/not-run <high>code</high>. </td> </tr> <tr> <td bgcolor="white"> <mono>include=T/F</mono> </td> <td bgcolor="white"> Include/exclude all <high>output</high>. </td> </tr> <tr> <td bgcolor="white"> <mono>message=T/F</mono> </td> <td bgcolor="white"> Include/exclude <highm>messages</highm> in output. </td> </tr> <tr> <td bgcolor="white"> <mono>warning=T/F</mono> </td> <td bgcolor="white"> Include/exclude <highm>warnings</highm>. </td> </tr> </table> <p align="center" style="font-size:12px;padding-top:10px"><mono>T/F = TRUE/FALSE</mono></p> ] .pull-right6[ <br> <p align = "center"> <img src="image/markdown_trans_9.png"> </p> ] --- # Chunks .pull-left3[ <table style="cellspacing:0; cellpadding:0; border:none; padding-top:60px" width=100%> <col width="60%"> <col width="40%"> <tr> <td bgcolor="white"> <b>Argument</b> </td> <td bgcolor="white"> <b>Description</b> </td> </tr> <tr> <td bgcolor="white"> <mono>echo=T/F</mono> </td> <td bgcolor="white"> Show/hide <high>code</high>. </td> </tr> <tr> <td bgcolor="white"> <mono>eval=T/F</mono> </td> <td bgcolor="white"> Run/not-run <high>code</high>. </td> </tr> <tr> <td bgcolor="white"> <mono>include=T/F</mono> </td> <td bgcolor="white"> Include/exclude all <high>output</high>. </td> </tr> <tr> <td bgcolor="white"> <mono>message=T/F</mono> </td> <td bgcolor="white"> Include/exclude <highm>messages</highm> in output. </td> </tr> <tr> <td bgcolor="white"> <mono>warning=T/F</mono> </td> <td bgcolor="white"> Include/exclude <highm>warnings</highm>. </td> </tr> </table> <p align="center" style="font-size:12px;padding-top:10px"><mono>T/F = TRUE/FALSE</mono></p> ] .pull-right6[ <br> <p align = "center"> <img src="image/markdown_trans_10.png"> </p> ] --- # Initial chunk .pull-left3[ <ul> <li class="m1"><span>Load packages and data in the <high>initial chunk</high>.</span></li> <li class="m2"><span>Additional <high>global behavior</high> is set in the YAML header.</span></li> </ul> ] .pull-right6[ <p align = "center"> <img src="image/markdown_trans_14.png"> </p> ] --- .pull-left4[ # YAML <ul> <li class="m1"><span><b>Y</b>AML <b>A</b>'int <b>M</b>arkup <b>L</b>anguage.<span></li> <li class="m2"><span>Enables the definition of general <high>properties of a document</high> and code inclusions.<span></li> </ul> <table style="cellspacing:0; cellpadding:0; border:none; padding-top:px" width=100%> <col width="60%"> <col width="40%"> <tr> <td bgcolor="white"> <b>Argument</b> </td> <td bgcolor="white"> <b>Description</b> </td> </tr> <tr> <td bgcolor="white"> <mono>echo=T/F</mono> </td> <td bgcolor="white"> Show/hide <high>code</high>. </td> </tr> <tr> <td bgcolor="white"> <mono>eval=T/F</mono> </td> <td bgcolor="white"> Run/not-run <high>code</high>. </td> </tr> <tr> <td bgcolor="white"> <mono>include=T/F</mono> </td> <td bgcolor="white"> Include/exclude all <high>output</high>. </td> </tr> <tr> <td bgcolor="white"> <mono>message=T/F</mono> </td> <td bgcolor="white"> Include/exclude <high>messages</high>. </td> </tr> <tr> <td bgcolor="white"> <mono>warning=T/F</mono> </td> <td bgcolor="white"> Include/exclude <highm>warnings</highm>. </td> </tr> </table> <p align="center" style="font-size:12px;padding-top:10px"><mono>T/F = TRUE/FALSE</mono></p> ] .pull-right5[ <br><br><br><br><br> <p align = "center"> <img src="image/markdown_trans_15.png"> </p> ] --- .pull-left4[ # YAML <ul> <li class="m1"><span><b>Y</b>AML <b>A</b>'int <b>M</b>arkup <b>L</b>anguage.<span></li> <li class="m2"><span>Enables the definition of general <high>properties of a document</high> and code inclusions.<span></li> </ul> <table style="cellspacing:0; cellpadding:0; border:none; padding-top:10px" width=100%> <col width="40%"> <col width="60%"> <tr> <td bgcolor="white"> <b>Argument</b> </td> <td bgcolor="white"> <b>Description</b> </td> </tr> <tr> <td bgcolor="white"> <mono>toc</mono> </td> <td bgcolor="white"> <b>T</b>able <b>O</b>f <b>C</b>ontents. </td> </tr> <tr> <td bgcolor="white"> <mono>toc_depth</mono> </td> <td bgcolor="white"> <high>Depth</high> of the <b>T</b>able <b>O</b>f <b>C</b>ontents. </td> </tr> <tr> <td bgcolor="white"> <mono>theme</mono> </td> <td bgcolor="white"> <high>Properties</high> of the layout. </td> </tr> <tr> <td bgcolor="white"> <mono>includes</mono> </td> <td bgcolor="white"> <high>Code inclusions</high> before (<mono>before_body</mono>), after (<mono>after_body</mono>) <mono>body</mono>, or <mono>in_header</mono>. </td> </tr> </table> ] .pull-right5[ <br> <div style="width:400px"> ````markdown --- format: html: toc: true --- ```` </div> <img src="image/yaml_2q.png" width=400px><br> ] --- .pull-left4[ # YAML <ul> <li class="m1"><span><b>Y</b>AML <b>A</b>'int <b>M</b>arkup <b>L</b>anguage.<span></li> <li class="m2"><span>Enables the definition of general <high>properties of a document</high> and code inclusions.<span></li> </ul> <table style="cellspacing:0; cellpadding:0; border:none; padding-top:10px" width=100%> <col width="40%"> <col width="60%"> <tr> <td bgcolor="white"> <b>Argument</b> </td> <td bgcolor="white"> <b>Description</b> </td> </tr> <tr> <td bgcolor="white"> <mono>toc</mono> </td> <td bgcolor="white"> <b>T</b>able <b>O</b>f <b>C</b>ontents. </td> </tr> <tr> <td bgcolor="white"> <mono>toc_depth</mono> </td> <td bgcolor="white"> <high>Depth</high> of the <b>T</b>able <b>O</b>f <b>C</b>ontents. </td> </tr> <tr> <td bgcolor="white"> <mono>theme</mono> </td> <td bgcolor="white"> <high>Properties</high> of the layout. </td> </tr> <tr> <td bgcolor="white"> <mono>includes</mono> </td> <td bgcolor="white"> <high>Code inclusions</high> before (<mono>before_body</mono>), after (<mono>after_body</mono>) <mono>body</mono>, or <mono>in_header</mono>. </td> </tr> </table> ] .pull-right5[ <br> <div style="width:400px"> ````markdown --- format: html: toc: true toc-location: body --- ```` </div> <img src="image/yaml_3q.png" width=400px><br> ] --- .pull-left4[ # YAML <ul> <li class="m1"><span><b>Y</b>AML <b>A</b>'int <b>M</b>arkup <b>L</b>anguage.<span></li> <li class="m2"><span>Enables the definition of general <high>properties of a document</high> and code inclusions.<span></li> </ul> <table style="cellspacing:0; cellpadding:0; border:none; padding-top:10px" width=100%> <col width="40%"> <col width="60%"> <tr> <td bgcolor="white"> <b>Argument</b> </td> <td bgcolor="white"> <b>Description</b> </td> </tr> <tr> <td bgcolor="white"> <mono>toc</mono> </td> <td bgcolor="white"> <b>T</b>able <b>O</b>f <b>C</b>ontents. </td> </tr> <tr> <td bgcolor="white"> <mono>toc_depth</mono> </td> <td bgcolor="white"> <high>Depth</high> of the <b>T</b>able <b>O</b>f <b>C</b>ontents. </td> </tr> <tr> <td bgcolor="white"> <mono>theme</mono> </td> <td bgcolor="white"> <high>Properties</high> of the layout. </td> </tr> <tr> <td bgcolor="white"> <mono>includes</mono> </td> <td bgcolor="white"> <high>Code inclusions</high> before (<mono>before_body</mono>), after (<mono>after_body</mono>) <mono>body</mono>, or <mono>in_header</mono>. </td> </tr> </table> ] .pull-right5[ <br> <div style="width:400px"> ````markdown --- format: html: toc: true toc-location: body toc-depth: 4 --- ```` </div> <img src="image/yaml_4q.png" width=400px><br> ] --- .pull-left4[ # YAML <ul> <li class="m1"><span><b>Y</b>AML <b>A</b>'int <b>M</b>arkup <b>L</b>anguage.<span></li> <li class="m2"><span>Enables the definition of general <high>properties of a document</high> and code inclusions.<span></li> </ul> <table style="cellspacing:0; cellpadding:0; border:none; padding-top:10px" width=100%> <col width="40%"> <col width="60%"> <tr> <td bgcolor="white"> <b>Argument</b> </td> <td bgcolor="white"> <b>Description</b> </td> </tr> <tr> <td bgcolor="white"> <mono>toc</mono> </td> <td bgcolor="white"> <b>T</b>able <b>O</b>f <b>C</b>ontents. </td> </tr> <tr> <td bgcolor="white"> <mono>toc_depth</mono> </td> <td bgcolor="white"> <high>Depth</high> of the <b>T</b>able <b>O</b>f <b>C</b>ontents. </td> </tr> <tr> <td bgcolor="white"> <mono>theme</mono> </td> <td bgcolor="white"> <high>Properties</high> of the layout. </td> </tr> <tr> <td bgcolor="white"> <mono>includes</mono> </td> <td bgcolor="white"> <high>Code inclusions</high> before (<mono>before_body</mono>), after (<mono>after_body</mono>) <mono>body</mono>, or <mono>in_header</mono>. </td> </tr> </table> ] .pull-right5[ <br> <div style="width:400px"> ````markdown --- format: html: toc: true toc-location: body toc-depth: 4 theme: lumen --- ```` </div> <img src="image/yaml_5q.png" width=400px><br> ] --- # Relative path .pull-left35[ <ul> <li class="m1"><span>When rendered, Quarto documents do not use the current <high>working directory</high>.</span></li><br> <li class="m2"><span>Paths need to be defined <high>relative to the position of the .qmd file</high>.</span></li> </ul> <br> ```R # load data read_csv("../1_data/data.csv") ``` ] .pull-right55[ <br> <p align = "center"> <img src="image/folder.png" width=50%> </p> ] --- .pull-left4[ # Scale graphs <ul> <li class="m1"><span>The general <high>appearance</high> of graphs can be modified in the <mono>chunk</mono>-settings or globally in the <mono>YAML header</mono>.</span></li> <li class="m2"><span>The arguments (normally) start with <highm>fig-*</highm>.</span></li> </ul> <table style="cellspacing:0; cellpadding:0; border:none; padding-top:10px" width=100%> <col width="40%"> <col width="60%"> <tr> <td bgcolor="white"> <b>Argument</b> </td> <td bgcolor="white"> <b>Description</b> </td> </tr> <tr> <td bgcolor="white"> <mono>fig-width</mono>, <mono>fig-height</mono> </td> <td bgcolor="white"> <high>Width</high> and <high>height</high> in inches. </td> </tr> <tr> <td bgcolor="white"> <mono>fig-asp</mono> </td> <td bgcolor="white"> <high>Aspect ratio</high>: Height relative to width. </td> </tr> <tr> <td bgcolor="white"> <mono>dpi</mono> </td> <td bgcolor="white"> <high>Resolution</high> of the graph (dots per inch). </td> </tr> </table> ] .pull-right5[ <br> <p align = "center"> <img src="image/plot_1.png" height=520px> </p> ] --- .pull-left4[ # Scale graphs <ul> <li class="m1"><span>The general <high>appearance</high> of graphs can be modified in the <mono>chunk</mono>-settings or globally in the <mono>YAML header</mono>.</span></li> <li class="m2"><span>The arguments (normally) start with <highm>fig-*</highm>.</span></li> </ul> <table style="cellspacing:0; cellpadding:0; border:none; padding-top:10px" width=100%> <col width="40%"> <col width="60%"> <tr> <td bgcolor="white"> <b>Argument</b> </td> <td bgcolor="white"> <b>Description</b> </td> </tr> <tr> <td bgcolor="white"> <mono>fig-width</mono>, <mono>fig-height</mono> </td> <td bgcolor="white"> <high>Width</high> and <high>height</high> in inches. </td> </tr> <tr> <td bgcolor="white"> <mono>fig-asp</mono> </td> <td bgcolor="white"> <high>Aspect ratio</high>: Height relative to width. </td> </tr> <tr> <td bgcolor="white"> <mono>dpi</mono> </td> <td bgcolor="white"> <high>Resolution</high> of the graph (dots per inch). </td> </tr> </table> ] .pull-right5[ <br> <p align = "center"> <img src="image/plot_2.png" height=520px> </p> ] --- .pull-left4[ # Scale graphs <ul> <li class="m1"><span>The general <high>appearance</high> of graphs can be modified in the <mono>chunk</mono>-settings or globally in the <mono>YAML header</mono>.</span></li> <li class="m2"><span>The arguments (normally) start with <highm>fig-*</highm>.</span></li> </ul> <table style="cellspacing:0; cellpadding:0; border:none; padding-top:10px" width=100%> <col width="40%"> <col width="60%"> <tr> <td bgcolor="white"> <b>Argument</b> </td> <td bgcolor="white"> <b>Description</b> </td> </tr> <tr> <td bgcolor="white"> <mono>fig-width</mono>, <mono>fig-height</mono> </td> <td bgcolor="white"> <high>Width</high> and <high>height</high> in inches. </td> </tr> <tr> <td bgcolor="white"> <mono>fig-asp</mono> </td> <td bgcolor="white"> <high>Aspect ratio</high>: Height relative to width. </td> </tr> <tr> <td bgcolor="white"> <mono>dpi</mono> </td> <td bgcolor="white"> <high>Resolution</high> of the graph (dots per inch). </td> </tr> </table> ] .pull-right5[ <br> <p align = "center"> <img src="image/plot_3.png" height=520px> </p> ] --- .pull-left4[ # Scale graphs <ul> <li class="m1"><span>The general <high>appearance</high> of graphs can be modified in the <mono>chunk</mono>-settings or globally in the <mono>YAML header</mono>.</span></li> <li class="m2"><span>The arguments (normally) start with <highm>fig-*</highm>.</span></li> </ul> <table style="cellspacing:0; cellpadding:0; border:none; padding-top:10px" width=100%> <col width="40%"> <col width="60%"> <tr> <td bgcolor="white"> <b>Argument</b> </td> <td bgcolor="white"> <b>Description</b> </td> </tr> <tr> <td bgcolor="white"> <mono>fig-width</mono>, <mono>fig-height</mono> </td> <td bgcolor="white"> <high>Width</high> and <high>height</high> in inches. </td> </tr> <tr> <td bgcolor="white"> <mono>fig-asp</mono> </td> <td bgcolor="white"> <high>Aspect ratio</high>: Height relative to width. </td> </tr> <tr> <td bgcolor="white"> <mono>dpi</mono> </td> <td bgcolor="white"> <high>Resolution</high> of the graph (dots per inch). </td> </tr> </table> ] .pull-right5[ <br> <p align = "center"> <img src="image/plot_4.png" height=520px> </p> ] --- .pull-left4[ # Scale graphs <ul> <li class="m1"><span>The general <high>appearance</high> of graphs can be modified in the <mono>chunk</mono>-settings or globally in the <mono>YAML header</mono>.</span></li> <li class="m2"><span>The arguments (normally) start with <highm>fig-*</highm>.</span></li> </ul> <table style="cellspacing:0; cellpadding:0; border:none; padding-top:10px" width=100%> <col width="40%"> <col width="60%"> <tr> <td bgcolor="white"> <b>Argument</b> </td> <td bgcolor="white"> <b>Description</b> </td> </tr> <tr> <td bgcolor="white"> <mono>fig-width</mono>, <mono>fig-height</mono> </td> <td bgcolor="white"> <high>Width</high> and <high>height</high> in inches. </td> </tr> <tr> <td bgcolor="white"> <mono>fig-asp</mono> </td> <td bgcolor="white"> <high>Aspect ratio</high>: Height relative to width. </td> </tr> <tr> <td bgcolor="white"> <mono>dpi</mono> </td> <td bgcolor="white"> <high>Resolution</high> of the graph (dots per inch). </td> </tr> </table> ] .pull-right5[ <br> <p align = "center"> <img src="image/plot_5.png" height=520px> </p> ] --- .pull-left4[ # Captions <ul> <li class="m1"><span>Add captions with <highm>fig-cap</highm>.</span></li> <li class="m2"><span>Define captions <high>within each chunk</high> starting with <mono>#|</mono>.</span></li> </ul> ] .pull-right5[ <br> <p align = "center"> <img src="image/plot_6.png" height=520px> </p> ] --- .pull-left4[ # Links, footnotes <ul> <li class="m1"><span>There is specific <high>markdown syntax</high> to include links and footnotes.</span></li> </ul> <table style="cellspacing:0; cellpadding:0; border:none; padding-top:10px" width=100%> <col width="40%"> <col width="60%"> <tr> <td bgcolor="white"> <b>Markdown</b> </td> <td bgcolor="white"> <b>Description</b> </td> </tr> <tr> <td bgcolor="white"> <mono>[Name](URL)</mono> </td> <td bgcolor="white"> <high>Link</high>. Name is displayed in the text, the URL is not displayed. </td> </tr> <tr> <td bgcolor="white"> <mono>^[Text]</mono> </td> <td bgcolor="white"> <high>Footnotes</high> are included after the end of the text. </td> </tr> </table> ] .pull-right5[ <br><br> <p align = "center"> <img src="image/links.png" height = 540px> </p> ] --- class: middle, center <h1><a href="Quarto_report.html">Practical</a></h1>