class: center, middle, inverse, title-slide # Xaringan ## A theme for the University of Sydney ### Garth Tarr ### 5 November 2018 --- ## Installing <svg viewBox="0 0 512 512" style="height:1em;display:inline-block;position:fixed;top:10;right:10;" xmlns="http://www.w3.org/2000/svg"> <path d="M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"></path></svg> The **xaringan** package is on CRAN, but I recommend installing the development release from <svg viewBox="0 0 496 512" style="height:1em;position:relative;display:inline-block;top:.1em;" xmlns="http://www.w3.org/2000/svg"> <path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg> ```r devtools::install_github('yihui/xaringan') ``` .pull-left[ You will also need two other CSS files for the custom University of Sydney styling: - `sydney-fonts.css` - `sydney.css` ] .pull-right[ If you want the University Logo to show up on the title slide, you'll also need - `USydLogo-black.svg` ] These are available in the assets folder of the GitHub code repository [<svg viewBox="0 0 496 512" style="height:1em;position:relative;display:inline-block;top:.1em;" xmlns="http://www.w3.org/2000/svg"> <path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg> `garthtarr/sydney_xaringan`](http://github.com/garthtarr/sydney_xaringan/assets) To make things easy to get started, I recommend downloading a copy of the `sydney_xaringan` repo [<svg viewBox="0 0 384 512" style="height:1em;position:relative;display:inline-block;top:.1em;" xmlns="http://www.w3.org/2000/svg"> <path d="M128.3 160v32h32v-32zm64-96h-32v32h32zm-64 32v32h32V96zm64 32h-32v32h32zm177.6-30.1L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM256 51.9l76.1 76.1H256zM336 464H48V48h79.7v16h32V48H208v104c0 13.3 10.7 24 24 24h104zM194.2 265.7c-1.1-5.6-6-9.7-11.8-9.7h-22.1v-32h-32v32l-19.7 97.1C102 385.6 126.8 416 160 416c33.1 0 57.9-30.2 51.5-62.6zm-33.9 124.4c-17.9 0-32.4-12.1-32.4-27s14.5-27 32.4-27 32.4 12.1 32.4 27-14.5 27-32.4 27zm32-198.1h-32v32h32z"></path></svg>](https://github.com/garthtarr/sydney_xaringan/archive/master.zip) and make changes to the template. --- background-image: url(https://upload.wikimedia.org/wikipedia/commons/b/be/Sharingan_triple.svg) background-size: 250px background-position: 50% 75% ## xaringan - Press `h` or `?` to see the possible ninjutsu you can use in remark.js. - You can see all the goodies like this (hint press `p`). - Check out more in-depth tutorial [here](https://slides.yihui.name/xaringan/#1) --- ## Why xaringan/remark.js? <svg viewBox="0 0 512 512" style="height:1em;display:inline-block;position:fixed;top:10;right:10;" xmlns="http://www.w3.org/2000/svg"> <path d="M256 8C119.033 8 8 119.033 8 256s111.033 248 248 248 248-111.033 248-248S392.967 8 256 8zm0 48c110.532 0 200 89.451 200 200 0 110.532-89.451 200-200 200-110.532 0-200-89.451-200-200 0-110.532 89.451-200 200-200m140.204 130.267l-22.536-22.718c-4.667-4.705-12.265-4.736-16.97-.068L215.346 303.697l-59.792-60.277c-4.667-4.705-12.265-4.736-16.97-.069l-22.719 22.536c-4.705 4.667-4.736 12.265-.068 16.971l90.781 91.516c4.667 4.705 12.265 4.736 16.97.068l172.589-171.204c4.704-4.668 4.734-12.266.067-16.971z"></path></svg> - Printing (in Google Chrome) is a lot more reliable for xaringan/remark.js - The customisation of the CSS and using it is a lot easier in xaringan/remark.js - You almost never need to write any manual HTML chunks (e.g. `<div style="text-align: center;"></div>`) - With remark.js' Markdown, you can add arbitrary CSS classes to elements using syntax `.className[elements]`, which is very handy compared to `<span class="className"></span>` - You can write slide notes under three question marks `???`. These notes are only displayed in the presentation mode, and only the speaker can see these notes. - The keyboard shortcuts: press keys like `P` (presentation mode), `C` (clone slides to a new window, useful for presentation mode), `B` (black out), `M` (mirror the slide), and `H` (help), etc. More: [yihui.name/en/2017/08/why-xaringan-remark-js/](https://yihui.name/en/2017/08/why-xaringan-remark-js/) --- ## Why **not** xaringan/remark.js? <svg viewBox="0 0 512 512" style="height:1em;display:inline-block;position:fixed;top:10;right:10;" xmlns="http://www.w3.org/2000/svg"> <path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm101.8-262.2L295.6 256l62.2 62.2c4.7 4.7 4.7 12.3 0 17l-22.6 22.6c-4.7 4.7-12.3 4.7-17 0L256 295.6l-62.2 62.2c-4.7 4.7-12.3 4.7-17 0l-22.6-22.6c-4.7-4.7-4.7-12.3 0-17l62.2-62.2-62.2-62.2c-4.7-4.7-4.7-12.3 0-17l22.6-22.6c4.7-4.7 12.3-4.7 17 0l62.2 62.2 62.2-62.2c4.7-4.7 12.3-4.7 17 0l22.6 22.6c4.7 4.7 4.7 12.3 0 17z"></path></svg> - It is difficult to generate self-contained HTML presentation files. I.e. you'll need access to the internet for it to work properly. However, the quality of the print to pdf means that you'll have excellent pdf backup slides but it will lack animation, gifs, etc. - You can't embed shiny apps (easily) and not all htmlwidgets are guaranteed to work. - I have a lot of ioslides and beamer content... but it's not so hard to translate from ioslides to xaringan (beamer's another story). - I haven't worked out how to activate slide scrolling. I've looked into it but I'm not sure if it's possible. Possibly a good thing, slide scrolling made me lazy with results presentation, and often caused issues with printing. --- ## googleVis Embedded by exporting to HTML and including as an iframe. <iframe src = "Geo.html" width = "100%" height = "90%" frameborder="0"></iframe> --- ## Content boxes <svg viewBox="0 0 512 512" style="height:1em;display:inline-block;position:fixed;top:10;right:10;" xmlns="http://www.w3.org/2000/svg"> <path d="M509.5 184.6L458.9 32.8C452.4 13.2 434.1 0 413.4 0H272v192h238.7c-.4-2.5-.4-5-1.2-7.4zM240 0H98.6c-20.7 0-39 13.2-45.5 32.8L2.5 184.6c-.8 2.4-.8 4.9-1.2 7.4H240V0zM0 224v240c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48V224H0z"></path></svg> .content-box-blue[This is a `.content-box-blue[]` chunk. ] -- If you have just a few words, it only highlights the words: .content-box-army[`.content-box-army[]`] .content-box-yellow[`.content-box-yellow[]`] .content-box-red[`.content-box-red[]`] .content-box-purple[`.content-box-purple[]`] -- If the text includes a new line character, you get a 100% width box. I've used `.columns-2[]` it's 100% of the column width. .columns-2[ .content-box-gray[ `.content-box-gray[]` ] .content-box-green[ `.content-box-green[]` ] ] --- ## Quotes <svg viewBox="0 0 512 512" style="height:1em;display:inline-block;position:fixed;top:10;right:10;" xmlns="http://www.w3.org/2000/svg"> <path d="M464 32H336c-26.5 0-48 21.5-48 48v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48zm-288 0H48C21.5 32 0 53.5 0 80v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48z"></path></svg> .small[ We can include **block quotes** using<br> `<blockquote>Quote goes here</blockquote>` or<br> `> Quote goes here` or `.blockquote[Quote here]` ] .pull-left[ <blockquote> Statistics is the grammar of science. .right[-- <cite>Karl Pearson</cite>] </blockquote> .blockquote[Quote] > Quote quote ] .pull-right[.small[ ``` <blockquote> Statistics is the grammar of science. .right[-- <cite>Karl Pearson</cite>] </blockquote> .blockquote[Quote] > Quote quote ``` ]] --- ## Statistical thinking Many of the data science slides have a quote-like box for **statistical thinking** or **aim**. .pull-left[ .small[ ``` .blockquote[ ### `r icons::fontawesome("comment-dots")` Statistical thinking - Point 1 ] ``` ] .blockquote[ ### <svg viewBox="0 0 512 512" style="height:1em;position:relative;display:inline-block;top:.1em;" xmlns="http://www.w3.org/2000/svg"> <path d="M144 208c-17.7 0-32 14.3-32 32s14.3 32 32 32 32-14.3 32-32-14.3-32-32-32zm112 0c-17.7 0-32 14.3-32 32s14.3 32 32 32 32-14.3 32-32-14.3-32-32-32zm112 0c-17.7 0-32 14.3-32 32s14.3 32 32 32 32-14.3 32-32-14.3-32-32-32zM256 32C114.6 32 0 125.1 0 240c0 47.6 19.9 91.2 52.9 126.3C38 405.7 7 439.1 6.5 439.5c-6.6 7-8.4 17.2-4.6 26S14.4 480 24 480c61.5 0 110-25.7 139.1-46.3C192 442.8 223.2 448 256 448c141.4 0 256-93.1 256-208S397.4 32 256 32zm0 368c-26.7 0-53.1-4.1-78.4-12.1l-22.7-7.2-19.5 13.8c-14.3 10.1-33.9 21.4-57.5 29 7.3-12.1 14.4-25.7 19.9-40.2l10.6-28.1-20.6-21.8C69.7 314.1 48 282.2 48 240c0-88.2 93.3-160 208-160s208 71.8 208 160-93.3 160-208 160z"></path></svg> Statistical thinking - Point 1 ] ] .pull-right[ .small[ ``` .blockquote[ ### `r icons::fontawesome("location-arrow")` Aim - Point 1 ] ``` ] .blockquote[ ### <svg viewBox="0 0 512 512" style="height:1em;position:relative;display:inline-block;top:.1em;" xmlns="http://www.w3.org/2000/svg"> <path d="M444.52 3.52L28.74 195.42c-47.97 22.39-31.98 92.75 19.19 92.75h175.91v175.91c0 51.17 70.36 67.17 92.75 19.19l191.9-415.78c15.99-38.39-25.59-79.97-63.97-63.97z"></path></svg> Aim - Point 1 ] ] .footnote[ This code is a bit easier to write than the old way of doing it. ``` <div class="thinkingbox"> ### <span class="fa-stack fa"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-location-arrow fa-stack-1x fa-inverse"></i></span> Aim - Point 1 </div> ``` ] --- ## Scrolling R output .scroll-output[ I tend to think it's best to format the slide such that everything you want to show is visible, however there can be times when the R output is extensive, and it's not important that the whole lot is printable (i.e. won't appear on the pdf version of the slides), but you might want to be able to scroll down interactively during the presentation. This can be done using the `.scroll-output[]` class. ```r step(lm(Fertility~.,data = swiss)) ``` ``` ## Start: AIC=190.69 ## Fertility ~ Agriculture + Examination + Education + Catholic + ## Infant.Mortality ## ## Df Sum of Sq RSS AIC ## - Examination 1 53.03 2158.1 189.86 ## <none> 2105.0 190.69 ## - Agriculture 1 307.72 2412.8 195.10 ## - Infant.Mortality 1 408.75 2513.8 197.03 ## - Catholic 1 447.71 2552.8 197.75 ## - Education 1 1162.56 3267.6 209.36 ## ## Step: AIC=189.86 ## Fertility ~ Agriculture + Education + Catholic + Infant.Mortality ## ## Df Sum of Sq RSS AIC ## <none> 2158.1 189.86 ## - Agriculture 1 264.18 2422.2 193.29 ## - Infant.Mortality 1 409.81 2567.9 196.03 ## - Catholic 1 956.57 3114.6 205.10 ## - Education 1 2249.97 4408.0 221.43 ``` ``` ## ## Call: ## lm(formula = Fertility ~ Agriculture + Education + Catholic + ## Infant.Mortality, data = swiss) ## ## Coefficients: ## (Intercept) Agriculture Education Catholic ## 62.1013 -0.1546 -0.9803 0.1247 ## Infant.Mortality ## 1.0784 ``` ] --- ## Scrolling R output If you just want a section of the output to be scrollable (not the whole page). You need to define how many lines you want the "box" to show. There are classes for `.scroll-box-8[]` for 8 lines, `.scroll-box-10[]` for 10 lines, ... , `.scroll-box-20[]` for 20 lines. .pull-left[ `.scroll-box-8[]` .scroll-box-8[ ```r swiss[,1:3] ``` ``` ## Fertility Agriculture Examination ## Courtelary 80.2 17.0 15 ## Delemont 83.1 45.1 6 ## Franches-Mnt 92.5 39.7 5 ## Moutier 85.8 36.5 12 ## Neuveville 76.9 43.5 17 ## Porrentruy 76.1 35.3 9 ## Broye 83.8 70.2 16 ## Glane 92.4 67.8 14 ## Gruyere 82.4 53.3 12 ## Sarine 82.9 45.2 16 ## Veveyse 87.1 64.5 14 ## Aigle 64.1 62.0 21 ## Aubonne 66.9 67.5 14 ## Avenches 68.9 60.7 19 ## Cossonay 61.7 69.3 22 ## Echallens 68.3 72.6 18 ## Grandson 71.7 34.0 17 ## Lausanne 55.7 19.4 26 ## La Vallee 54.3 15.2 31 ## Lavaux 65.1 73.0 19 ## Morges 65.5 59.8 22 ## Moudon 65.0 55.1 14 ## Nyone 56.6 50.9 22 ## Orbe 57.4 54.1 20 ## Oron 72.5 71.2 12 ## Payerne 74.2 58.1 14 ## Paysd'enhaut 72.0 63.5 6 ## Rolle 60.5 60.8 16 ## Vevey 58.3 26.8 25 ## Yverdon 65.4 49.5 15 ## Conthey 75.5 85.9 3 ## Entremont 69.3 84.9 7 ## Herens 77.3 89.7 5 ## Martigwy 70.5 78.2 12 ## Monthey 79.4 64.9 7 ## St Maurice 65.0 75.9 9 ## Sierre 92.2 84.6 3 ## Sion 79.3 63.1 13 ## Boudry 70.4 38.4 26 ## La Chauxdfnd 65.7 7.7 29 ## Le Locle 72.7 16.7 22 ## Neuchatel 64.4 17.6 35 ## Val de Ruz 77.6 37.6 15 ## ValdeTravers 67.6 18.7 25 ## V. De Geneve 35.0 1.2 37 ## Rive Droite 44.7 46.6 16 ## Rive Gauche 42.8 27.7 22 ``` ]] .pull-right[ `.scroll-box-14[]` .scroll-box-14[ ```r swiss[,1:3] ``` ``` ## Fertility Agriculture Examination ## Courtelary 80.2 17.0 15 ## Delemont 83.1 45.1 6 ## Franches-Mnt 92.5 39.7 5 ## Moutier 85.8 36.5 12 ## Neuveville 76.9 43.5 17 ## Porrentruy 76.1 35.3 9 ## Broye 83.8 70.2 16 ## Glane 92.4 67.8 14 ## Gruyere 82.4 53.3 12 ## Sarine 82.9 45.2 16 ## Veveyse 87.1 64.5 14 ## Aigle 64.1 62.0 21 ## Aubonne 66.9 67.5 14 ## Avenches 68.9 60.7 19 ## Cossonay 61.7 69.3 22 ## Echallens 68.3 72.6 18 ## Grandson 71.7 34.0 17 ## Lausanne 55.7 19.4 26 ## La Vallee 54.3 15.2 31 ## Lavaux 65.1 73.0 19 ## Morges 65.5 59.8 22 ## Moudon 65.0 55.1 14 ## Nyone 56.6 50.9 22 ## Orbe 57.4 54.1 20 ## Oron 72.5 71.2 12 ## Payerne 74.2 58.1 14 ## Paysd'enhaut 72.0 63.5 6 ## Rolle 60.5 60.8 16 ## Vevey 58.3 26.8 25 ## Yverdon 65.4 49.5 15 ## Conthey 75.5 85.9 3 ## Entremont 69.3 84.9 7 ## Herens 77.3 89.7 5 ## Martigwy 70.5 78.2 12 ## Monthey 79.4 64.9 7 ## St Maurice 65.0 75.9 9 ## Sierre 92.2 84.6 3 ## Sion 79.3 63.1 13 ## Boudry 70.4 38.4 26 ## La Chauxdfnd 65.7 7.7 29 ## Le Locle 72.7 16.7 22 ## Neuchatel 64.4 17.6 35 ## Val de Ruz 77.6 37.6 15 ## ValdeTravers 67.6 18.7 25 ## V. De Geneve 35.0 1.2 37 ## Rive Droite 44.7 46.6 16 ## Rive Gauche 42.8 27.7 22 ``` ]] --- ## Lists, increments and footnotes<svg viewBox="0 0 512 512" style="height:1em;display:inline-block;position:fixed;top:10;right:10;" xmlns="http://www.w3.org/2000/svg"> <path d="M80 368H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm0-320H16A16 16 0 0 0 0 64v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16zm0 160H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm416 176H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z"></path></svg> .pull-left[ - Unordered lists<sup>1</sup> - can be created using "-" - and they can be nested using 2 or 4 space.fn[2] - deep nested - original nesting level ### Ordered list 1. one 2. two 3. three ] .footnote[ [1] Footnotes are not automatic. In the text use `<sup>1</sup>` or `.fn[1]` [2] At the end of the slide `.footnote[[1] Text associated with footnote 1.]` ] -- .pull-right[ To get an incremental slide use two dashes `--` on a new line with no trailing white space. If the dashes aren't on their own line or there's a white space after it won't work. .font80[.content-box-purple[ The two dash increments don't work inside class calls. For example, you can't have an increment in a `.pull-right[...]` block or in a `.columns-2[...]` block as the dashes are not considered to be special in the markdown processing when they're inside one of these blocks. ]] ] --- ## Icons <svg viewBox="0 0 192 512" style="height:1em;display:inline-block;position:fixed;top:10;right:10;" xmlns="http://www.w3.org/2000/svg"> <path d="M176 432c0 44.112-35.888 80-80 80s-80-35.888-80-80 35.888-80 80-80 80 35.888 80 80zM25.26 25.199l13.6 272C39.499 309.972 50.041 320 62.83 320h66.34c12.789 0 23.331-10.028 23.97-22.801l13.6-272C167.425 11.49 156.496 0 142.77 0H49.23C35.504 0 24.575 11.49 25.26 25.199z"></path></svg> Perhaps the easiest way to include icons in your xaringan presentations is through the [**icons** package](https://github.com/mitchelloharawild/icons). The **icons** package lets you include [font awesome](http://fontawesome.io) icons and others into R Markdown documents. It's not on CRAN, but you can install it using ```r remotes::install_github("mitchelloharawild/icons") ``` -- .pull-left[ ```r icons::fontawesome("rocket") ``` <svg viewBox="0 0 512 512" style="height:1em;position:relative;display:inline-block;top:.1em;" xmlns="http://www.w3.org/2000/svg"> <path d="M505.12019,19.09375c-1.18945-5.53125-6.65819-11-12.207-12.1875C460.716,0,435.507,0,410.40747,0,307.17523,0,245.26909,55.20312,199.05238,128H94.83772c-16.34763.01562-35.55658,11.875-42.88664,26.48438L2.51562,253.29688A28.4,28.4,0,0,0,0,264a24.00867,24.00867,0,0,0,24.00582,24H127.81618l-22.47457,22.46875c-11.36521,11.36133-12.99607,32.25781,0,45.25L156.24582,406.625c11.15623,11.1875,32.15619,13.15625,45.27726,0l22.47457-22.46875V488a24.00867,24.00867,0,0,0,24.00581,24,28.55934,28.55934,0,0,0,10.707-2.51562l98.72834-49.39063c14.62888-7.29687,26.50776-26.5,26.50776-42.85937V312.79688c72.59753-46.3125,128.03493-108.40626,128.03493-211.09376C512.07526,76.5,512.07526,51.29688,505.12019,19.09375ZM384.04033,168A40,40,0,1,1,424.05,128,40.02322,40.02322,0,0,1,384.04033,168Z"></path></svg> ```r icons::fontawesome("spinner") ``` <svg viewBox="0 0 512 512" style="height:1em;position:relative;display:inline-block;top:.1em;" xmlns="http://www.w3.org/2000/svg"> <path d="M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z"></path></svg> ] -- .pull-right[ Inline expressions also work. <svg viewBox="0 0 448 512" style="height:1em;position:relative;display:inline-block;top:.1em;" xmlns="http://www.w3.org/2000/svg"> <path d="M439.39 362.29c-19.32-20.76-55.47-51.99-55.47-154.29 0-77.7-54.48-139.9-127.94-155.16V32c0-17.67-14.32-32-31.98-32s-31.98 14.33-31.98 32v20.84C118.56 68.1 64.08 130.3 64.08 208c0 102.3-36.15 133.53-55.47 154.29-6 6.45-8.66 14.16-8.61 21.71.11 16.4 12.98 32 32.1 32h383.8c19.12 0 32-15.6 32.1-32 .05-7.55-2.61-15.27-8.61-21.71zM67.53 368c21.22-27.97 44.42-74.33 44.53-159.42 0-.2-.06-.38-.06-.58 0-61.86 50.14-112 112-112s112 50.14 112 112c0 .2-.06.38-.06.58.11 85.1 23.31 131.46 44.53 159.42H67.53zM224 512c35.32 0 63.97-28.65 63.97-64H160.03c0 35.35 28.65 64 63.97 64z"></path></svg> created using `` `r icons::fontawesome("bell")` `` <br> For more info see [the <svg viewBox="0 0 496 512" style="height:1em;position:relative;display:inline-block;top:.1em;" xmlns="http://www.w3.org/2000/svg"> <path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg> repo](https://github.com/ropenscilabs/icon). ] --- ## Data tables <svg viewBox="0 0 512 512" style="height:1em;display:inline-block;position:fixed;top:10;right:10;" xmlns="http://www.w3.org/2000/svg"> <path d="M464 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48zM224 416H64v-96h160v96zm0-160H64v-96h160v96zm224 160H288v-96h160v96zm0-160H288v-96h160v96z"></path></svg> .font80[ ```r library("DT"); library("dplyr") iris %>% DT::datatable(class = "compact", rownames = FALSE, extensions = "Buttons", options = list(dom = 'tBp', buttons = c("csv","excel"), pageLength = 8)) %>% DT::formatRound(1:4, digits = 1) ```
] --- ## FAQ <svg viewBox="0 0 512 512" style="height:1em;display:inline-block;position:fixed;top:10;right:10;" xmlns="http://www.w3.org/2000/svg"> <path d="M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 448c-110.532 0-200-89.431-200-200 0-110.495 89.472-200 200-200 110.491 0 200 89.471 200 200 0 110.53-89.431 200-200 200zm107.244-255.2c0 67.052-72.421 68.084-72.421 92.863V300c0 6.627-5.373 12-12 12h-45.647c-6.627 0-12-5.373-12-12v-8.659c0-35.745 27.1-50.034 47.579-61.516 17.561-9.845 28.324-16.541 28.324-29.579 0-17.246-21.999-28.693-39.784-28.693-23.189 0-33.894 10.977-48.942 29.969-4.057 5.12-11.46 6.071-16.666 2.124l-27.824-21.098c-5.107-3.872-6.251-11.066-2.644-16.363C184.846 131.491 214.94 112 261.794 112c49.071 0 101.45 38.304 101.45 88.8zM298 368c0 23.159-18.841 42-42 42s-42-18.841-42-42 18.841-42 42-42 42 18.841 42 42z"></path></svg> <blockquote> How do I start a new slide? </blockquote> Using three dashes at the start of a new line <code>---</code> -- <blockquote> I have three dashes but it's not starting a new slide. </blockquote> The three dashes need to be on their own line with **no spaces after them** -- <blockquote> I'm giving my presentation but the text is too small. HELP! </blockquote> By default remark.js disables browser based zooming. I've found and modified a hack to re-enable it, but it's not perfect. [`remark-zoom.js`](https://github.com/William-Yeh/remark-zoom) I'm also open to increasing the default font size - need to test it out on a range of displays. --- background-image: url("assets/title-image1.jpg") background-position: 100% 50% background-size: 50% 75% ## Background images .pull-left[ - We can place images anywhere on the screen by using `background-image` in conjunction with <br>`background-position` - The image, size and position are defined immediately after the `---` that starts a new slide. Assuming `image.jpg` is in the same folder as your `.Rmd` file, the code is: ``` --- background-image: url("image.jpg") background-position: 100% 50% background-size: 50% 75% ## Background images .pull-left[ ... Left column text here ... ] ``` ] --- class: center, middle # Text adjustments It is also possible to change the .blue[color] of any text by using `.color[text here]` -- For example `.grey[grey]` will make text .grey[grey]. -- We can do this with white, .brand-red[Sydney master brand red], .brand-blue[Sydney master brand blue], .brand-yellow[Sydney master brand yellow], .brand-charcoal[Sydney master brand charcoal], .brand-grey[Sydney master brand grey], .black[black], .red[red], .blue[blue], .green[green], .yellow[yellow], .orange[orange], .purple[purple], .grey[grey]. -- To make text stand out we can use standard markdown `**text**` like **this** or `.bold[this]` .bold[this]. Or italics using `_italic_` _italic_. You can string together these formats, e.g. `.blue[.bold[...]]` to get .blue[.bold[blue and bold text]]. -- .left[.footnote[The text on this slide is centered and in the middle of the slide because the slide began with: ``` --- class: center, middle ``` ]] --- class: sydney-yellow ## Two columns! <svg viewBox="0 0 512 512" style="height:1em;display:inline-block;position:fixed;top:10;right:10;" xmlns="http://www.w3.org/2000/svg"> <path d="M464 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48zM224 416H64V160h160v256zm224 0H288V160h160v256z"></path></svg> .pull-left[ ### Some things on the left 1. List of things; 1. Plain Markdown; 1. blah blah; and 1. Plain Markdown ] -- .pull-right[ ### and other things on the right We do this by using the `.pull-left[]` and `.pull-right[]` commands. Just put any text inside the brackets and you're good to go ] Code below (or above) these two has no problem extending the full width of the slide. .footnote[The background of this slide is Sydney University Yellow because the slide began with: ``` --- class: sydney-yellow ``` ] --- ## R code and highlighting <svg viewBox="0 0 581 512" style="height:1em;display:inline-block;position:fixed;top:10;right:10;" xmlns="http://www.w3.org/2000/svg"> <path d="M581 226.6C581 119.1 450.9 32 290.5 32S0 119.1 0 226.6C0 322.4 103.3 402 239.4 418.1V480h99.1v-61.5c24.3-2.7 47.6-7.4 69.4-13.9L448 480h112l-67.4-113.7c54.5-35.4 88.4-84.9 88.4-139.7zm-466.8 14.5c0-73.5 98.9-133 220.8-133s211.9 40.7 211.9 133c0 50.1-26.5 85-70.3 106.4-2.4-1.6-4.7-2.9-6.4-3.7-10.2-5.2-27.8-10.5-27.8-10.5s86.6-6.4 86.6-92.7-90.6-87.9-90.6-87.9h-199V361c-74.1-21.5-125.2-67.1-125.2-119.9zm225.1 38.3v-55.6c57.8 0 87.8-6.8 87.8 27.3 0 36.5-38.2 28.3-87.8 28.3zm-.9 72.5H365c10.8 0 18.9 11.7 24 19.2-16.1 1.9-33 2.8-50.6 2.9v-22.1z"></path></svg> .pull-left[ An example using a leading `*`: ```r if (TRUE) { ** message("Very important!") } ``` Output: ```r if (TRUE) { * message("Very important!") } ``` This is invalid R code, so it is a plain fenced code block that is not executed. ] .pull-right[ An example using `{{}}`: ```{r tidy=FALSE} if (TRUE) { *{{ message("Very important!") }} } ``` Output: ```r if (TRUE) { * message("Very important!") } ``` ``` ## Very important! ``` It is valid R code so you can run it. ] --- ## R code and plot output <svg viewBox="0 0 581 512" style="height:1em;display:inline-block;position:fixed;top:10;right:10;" xmlns="http://www.w3.org/2000/svg"> <path d="M581 226.6C581 119.1 450.9 32 290.5 32S0 119.1 0 226.6C0 322.4 103.3 402 239.4 418.1V480h99.1v-61.5c24.3-2.7 47.6-7.4 69.4-13.9L448 480h112l-67.4-113.7c54.5-35.4 88.4-84.9 88.4-139.7zm-466.8 14.5c0-73.5 98.9-133 220.8-133s211.9 40.7 211.9 133c0 50.1-26.5 85-70.3 106.4-2.4-1.6-4.7-2.9-6.4-3.7-10.2-5.2-27.8-10.5-27.8-10.5s86.6-6.4 86.6-92.7-90.6-87.9-90.6-87.9h-199V361c-74.1-21.5-125.2-67.1-125.2-119.9zm225.1 38.3v-55.6c57.8 0 87.8-6.8 87.8 27.3 0 36.5-38.2 28.3-87.8 28.3zm-.9 72.5H365c10.8 0 18.9 11.7 24 19.2-16.1 1.9-33 2.8-50.6 2.9v-22.1z"></path></svg> ```r library("tidyverse") cars %>% ggplot(aes(x = dist, y = speed)) + geom_point() + * geom_smooth(method = 'lm', # highlighted using {{... formula = y ~ poly(x, 2))}} + theme_bw(base_size = 24) + labs(y = "Speed (mph)", x = "Stopping distance (ft)") ``` <img src="index_files/figure-html/unnamed-chunk-9-1.png" width="864" style="display: block; margin: auto;" /> --- class: middle, bottom background-image: url("assets/USydLogo.svg") background-size: 50% background-position: 90% 10% This slide starts with ``` --- class: middle, bottom background-image: url("assets/USydLogo.svg") background-size: 50% background-position: 90% 10% ``` If you want the background image to take up the full slide use ``` --- class: middle, bottom background-image: url("assets/USydLogo.svg") *background-size: contain *background-position: 50% 50% ``` --- class: segue # Next section .left[.footnote[ ``` --- class: segue ``` ]] --- class: segue-red # Next section .left[.footnote[ ``` --- class: segue-red ``` ]] --- class: segue-yellow background-image: url("assets/USydLogo.svg") background-size: 20% background-position: 95% 95% # Next section .left[.footnote[ ``` --- class: segue-yellow background-image: url("assets/USydLogo.svg") background-size: 20% background-position: 95% 95% ``` ]] --- class: sydney-blue ## Title for sydney-blue class text here .footnote[ ``` --- class: sydney-blue ``` ] --- class: sydney-red ## .white[Title for sydney-red class] text here .footnote[ ``` --- class: sydney-red ``` ] --- class: sydney-yellow ## Title for sydney-yellow class text here .footnote[ ``` --- class: sydney-yellow ``` ] --- ## Title slide image .small[ I don't have a good solution for the title slide image. I considered hard coding it to look for a file called `title-image.jpg` in the same folder as the `sydney.css` file. This is possible and if this file is missing, it's no problem, it just won't show an image. The image would be hardcoded to be stretched the full height of the title slide and to only take up 50% of the width. But I decided this was less than optimal. In the longer term, I'd like to make this more general, being able to specify the file path in the yaml along with the size and position. I'd also like to be able to specify the background colour. But I have no idea if this is technically feasible or not. In the iterim, you can specify `seal: false` in the yaml to disable the default title slide and create your own. For example: ] .code70[ ``` --- class: title-slide background-image: url("assets/USydLogo-black.svg"), url("assets/title-image2.jpg") background-position: 10% 90%, 100% 50% background-size: 160px, 100% 100% # .black[Manual title slide] ## Subtitle ### Author ### Date ``` ] --- class: title-slide background-image: url("assets/USydLogo.svg"), url("assets/title-image1.jpg") background-position: 10% 90%, 100% 50% background-size: 160px, 100% 100% # .text-shadow[.black[Manual title slide (title-image.1)]] ## Subtitle ### Author ### Date --- class: title-slide background-image: url("assets/USydLogo-white.svg"), url("assets/title-image1.jpg") background-position: 10% 90%, 100% 50% background-size: 160px, 50% 100% background-color: #0148A4 # .text-shadow[.white[Manual title slide]] ## .white[Subtitle] ### .white[Author] ### .white[Date] --- class: title-slide background-image: url("assets/USydLogo-black.svg"), url("assets/title-image2.jpg") background-position: 10% 90%, 100% 50% background-size: 160px, 100% 100% # .text-shadow[.black[Manual title slide]] ## Subtitle ### Author ### Date --- ## Example YAML .code70[ ```r --- title: "Xaringan" subtitle: "A theme for the <br>University of Sydney" author: "Garth Tarr" date: "15 May 2018" output: xaringan::moon_reader: css: ["default", "assets/sydney-fonts.css", "assets/sydney.css"] self_contained: false # if true, fonts will be stored locally seal: true # show a title slide with YAML information includes: in_header: "assets/mathjax-equation-numbers.html" nature: beforeInit: ["assets/remark-zoom.js", "https://platform.twitter.com/widgets.js"] highlightStyle: github highlightLines: true countIncrementalSlides: false ratio: '4:3' # alternatives '16:9' or '4:3' or others e.g. 13:9 navigation: scroll: false # disable slide transitions by scrolling --- class: title-slide background-image: url("assets/USydLogo-white.svg"), url("assets/title-image1.jpg") background-position: 10% 90%, 100% 50% background-size: 160px, 50% 100% background-color: #0148A4 # Manually specify title here ## Manually specify subtitle here ### Manually specify author here ### Manually specify date here ``` ] --- ## Font sizes .pull-left[ .pull-left[ .font10[.font10] .font20[.font20] .font30[.font30] .font40[.font40] .font50[.font50] .font60[.font60] .font70[.font70] .font80[.font80] .font90[.font90] Standard .font110[.font110] .font120[.font120] .font130[.font130] .font140[.font140] .font150[.font150] .font160[.font160] .font170[.font170] .font180[.font180] .font190[.font190] .font200[.font200] ] .pull-right[ .code10[`.code10[]`] .code20[`.code20[]`] .code30[`.code30[]`] .code40[`.code40[]`] .code50[`.code50[]`] .code60[`.code60[]`] .code70[`.code70[]`] .code80[`.code80[]`] .code90[`.code90[]`] `standard` .code110[`.code110[]`] .code120[`.code120[]`] .code130[`.code130[]`] .code140[`.code140[]`] .code150[`.code150[]`] .code160[`.code160[]`] .code170[`.code170[]`] .code180[`.code180[]`] .code190[`.code190[]`] .code200[`.code200[]`] ] ] .pull-right[ I've also enabled an alternate approach, that operates on all text: inline code, code chunks and regular text. .Large[.Large `.Large[]` 144%] .large[.large `.large[]` 120%] .small[.small `.small[]` 90%] .footnotesize[.footnotesize `.footnotesize[]` 80%] .scriptsize[.scriptsize `.scriptsize[]` 70%] .tiny[.tiny `.tiny[]` 60%] ] --- ## Font sizes This is normal sized and coloured text. With a normal size code and output: ```r rnorm(2) ``` ``` ## [1] -0.9363944 0.7678495 ``` .blue[.small[This blue text is in a `.blue[.small[...]]` chunk. Everything is shrunk to 90% including the `inline code` as well as code chunks and their output: ```r rnorm(2) ``` ``` ## [1] -0.5446421 -0.0785827 ``` ]] --- class: columns-2 ## Equations MathJax is supported out of the box. You can put inline equations inside dollar signs, e.g. `$\alpha + \beta$` renders as `\(\alpha + \beta\)`. Display style works with double dollar signs: <span>`$`</span><span>`$`</span>`\bar{X} = \frac{1}{n} \sum_{i=1}^n X_i`<span>`$`</span><span>`$`</span> `$$\bar{X} = \frac{1}{n}\sum_{i=1}^n X_i$$` For multi-line equations you can use <span>`\`</span>`begin{align} ... `</span>`\`</span>`end{align}` `\begin{align} \bar{X} & = X_1 + X_2 + \ldots + X_n \nonumber \\ & = \frac{1}{n}\sum_{i=1}^nX_i \label{good-eq} \end{align}` Note the equation number! We can reference it in the usual way, using <span>`\`</span>`eqref{label}`, \eqref{good-eq}, or <span>`\`</span>`ref{label}`, \ref{good-eq}. --- ## Equation numbering Equation numbering isn't part of the standard xaringan package but I've included it with the Sydney theme. This is enabled with the inclusion of the `in_header` line in the YAML with reference to the file `mathjax-equation-numbers.html` which needs to be in an appropriate location. ``` output: xaringan::moon_reader: includes: * in_header: "assets/mathjax-equation-numbers.html" ``` --- ## Central limit theorem Let `\(X_{1}, X_{2},\ldots\)` be independent random variables with characteristic functions `\(\phi_{1},\phi_{2},\ldots\)` and distribution functions `\(F_{1},F_{2},\ldots\)` and let `\(\mathbb{E} X_{i}=0\)` and `\(\mathbb{E} X_{i}^{2}=\sigma_{i}^{2}<\infty\)`, `\(i=1,2,\ldots\)`. Write `\(S_{n} = \sum_{i=1}^{n}X_{i}\)` and `\(s_{n}=\textrm{Var}(S_{n}) = \sum_{i=1}^{n}\sigma^{2}_{i}\)`. Let `\begin{align} L_{n}(\varepsilon) & = s^{-2}_{n}\sum_{i=1}^{n}\mathbb{E}\big[ X_{i}^{2}\mathbb{I}\big(|X_{i}|>\varepsilon s_{n}\big)\big] \nonumber \\ & = s_{n}^{-2}\sum_{i=1}^{n}\int_{|x|>\varepsilon s_{n}}x^{2}\operatorname{d}F_{n}(x) \end{align}` The _Lindeberg condition_ states: `$$\begin{equation}\text{for all } \varepsilon>0,\ L_{n}(\varepsilon)\rightarrow0 \text{ as }n\rightarrow\infty.\label{LindCond}\end{equation}$$` If `\(\mathbb{E}|X_{1}|^{3}<\infty\)` and `\(s_{n}^{-3}\sum_{i=1}^{n}\mathbb{E}|X_{i}^{3}|\rightarrow 0\)` as `\(n\rightarrow\infty\)` then Lindeberg's condition holds. This condition under which the Lindeberg's condition holds is known as Liapounov's condition \eqref{LindCond}. --- # Tables .pull-left[ - Tables are centered by default in **xaringan**. - We can override this using `.pull-left[]` and `.pull-right[]` | This | is | a | table | | :---- | :-- | -----: | :----------: | | It is | now | pulled | to the left | | 12 | 34 | 56 | 78 | ] .pull-right[ ```r knitr::kable(iris[1:10, 1:4], format = "html") ``` .small[ <table> <thead> <tr> <th style="text-align:right;"> Sepal Length </th> <th style="text-align:right;"> Sepal Width </th> <th style="text-align:right;"> Petal Length </th> <th style="text-align:right;"> Petal Width </th> </tr> </thead> <tbody> <tr> <td style="text-align:right;"> 5.1 </td> <td style="text-align:right;"> 3.5 </td> <td style="text-align:right;"> 1.4 </td> <td style="text-align:right;"> 0.2 </td> </tr> <tr> <td style="text-align:right;"> 4.9 </td> <td style="text-align:right;"> 3.0 </td> <td style="text-align:right;"> 1.4 </td> <td style="text-align:right;"> 0.2 </td> </tr> <tr> <td style="text-align:right;"> 4.7 </td> <td style="text-align:right;"> 3.2 </td> <td style="text-align:right;"> 1.3 </td> <td style="text-align:right;"> 0.2 </td> </tr> <tr> <td style="text-align:right;"> 4.6 </td> <td style="text-align:right;"> 3.1 </td> <td style="text-align:right;"> 1.5 </td> <td style="text-align:right;"> 0.2 </td> </tr> <tr> <td style="text-align:right;"> 5.0 </td> <td style="text-align:right;"> 3.6 </td> <td style="text-align:right;"> 1.4 </td> <td style="text-align:right;"> 0.2 </td> </tr> <tr> <td style="text-align:right;"> 5.4 </td> <td style="text-align:right;"> 3.9 </td> <td style="text-align:right;"> 1.7 </td> <td style="text-align:right;"> 0.4 </td> </tr> <tr> <td style="text-align:right;"> 4.6 </td> <td style="text-align:right;"> 3.4 </td> <td style="text-align:right;"> 1.4 </td> <td style="text-align:right;"> 0.3 </td> </tr> <tr> <td style="text-align:right;"> 5.0 </td> <td style="text-align:right;"> 3.4 </td> <td style="text-align:right;"> 1.5 </td> <td style="text-align:right;"> 0.2 </td> </tr> <tr> <td style="text-align:right;"> 4.4 </td> <td style="text-align:right;"> 2.9 </td> <td style="text-align:right;"> 1.4 </td> <td style="text-align:right;"> 0.2 </td> </tr> <tr> <td style="text-align:right;"> 4.9 </td> <td style="text-align:right;"> 3.1 </td> <td style="text-align:right;"> 1.5 </td> <td style="text-align:right;"> 0.1 </td> </tr> </tbody> </table> ] ] --- ## Citations and references <svg viewBox="0 0 448 512" style="height:1em;display:inline-block;position:fixed;top:10;right:10;" xmlns="http://www.w3.org/2000/svg"> <path d="M448 360V24c0-13.3-10.7-24-24-24H96C43 0 0 43 0 96v320c0 53 43 96 96 96h328c13.3 0 24-10.7 24-24v-16c0-7.5-3.5-14.3-8.9-18.7-4.2-15.4-4.2-59.3 0-74.7 5.4-4.3 8.9-11.1 8.9-18.6zM128 134c0-3.3 2.7-6 6-6h212c3.3 0 6 2.7 6 6v20c0 3.3-2.7 6-6 6H134c-3.3 0-6-2.7-6-6v-20zm0 64c0-3.3 2.7-6 6-6h212c3.3 0 6 2.7 6 6v20c0 3.3-2.7 6-6 6H134c-3.3 0-6-2.7-6-6v-20zm253.4 250H96c-17.7 0-32-14.3-32-32 0-17.6 14.4-32 32-32h285.4c-1.9 17.1-1.9 46.9 0 64z"></path></svg> .pull-left[ Xaringan doesn't support bibliographies in the usual markdown way (i.e. specifying a bibtex file in the yaml). It is possible to cite sources from a `.bib` file using the **RefManageR** package. To do this, specify the `BibOptions()`: .small[ ```r library(RefManageR) BibOptions( check.entries = FALSE, bib.style = "authoryear", cite.style = "authoryear", style = "markdown", hyperlink = FALSE, dashed = FALSE) *myBib = ReadBib("myBib.bib") ``` ] ] .pull-right[ Make sure you update the highlighted line. Then you can cite any entry from your `.bib` file inline using `Citet()`, `Citep()`, `AutoCite()`, etc. (see [RefManageR](https://github.com/ropensci/RefManageR)). - Tarr, Müller, and Weber (2016) - (Tarr, Müller, and Weber, 2016) ] --- ## Reference list To generate your bibliography, use the `PrintBibliography()` function inside a knitr chunk with options `results='asis', echo=FALSE`. The function will search the entire `.Rmd` document for your citations and include them in the output. Tarr, G., S. Müller, and N. Weber (2016). "Robust estimation of precision matrices under cellwise contamination". In: _Computational Statistics & Data Analysis_ 93, pp. 404-420. DOI: [10.1016/j.csda.2015.02.005](https://doi.org/10.1016%2Fj.csda.2015.02.005). If you have a long list of references, and want to split them over multiple slides, you can use the `start` and `end` arguments to the `PrintBibliography()` function. E.g. .small[ `PrintBibliography(bib, start=1, end=7)` ] --- ## Embedding tweets .pull-left[ 1. Get the link to embed the tweet from twitter. 2. Paste it into your slides. 3. Make sure the highlighted code from below is is in your YAML .footnote[.small[ ``` output: xaringan::moon_reader: nature: * beforeInit: ["assets/remark-zoom.js", "https://platform.twitter.com/widgets.js"] ``` ]] ] .pull-right[ <blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr">Finally finished documenting the xaringan pkg for Rmd/remark.js-based slides w/ another weekend <a href="https://t.co/1mkJYj13WR">https://t.co/1mkJYj13WR</a> Now I can sleep well <a href="https://t.co/k6hj6xDrwF">pic.twitter.com/k6hj6xDrwF</a></p>— Yihui Xie (@xieyihui) <a href="https://twitter.com/xieyihui/status/808418548829847552?ref_src=twsrc%5Etfw">December 12, 2016</a></blockquote> ] --- class: sydney-blue background-image: url(assets/USydLogo-white.svg) background-size: 260px background-position: 5% 95% # Thanks! .pull-right[.pull-down[ <a href="mailto:garth.tarr@sydney.edu.au"> .white[<svg viewBox="0 0 512 512" style="height:1em;position:relative;display:inline-block;top:.1em;" xmlns="http://www.w3.org/2000/svg"> <path d="M440 6.5L24 246.4c-34.4 19.9-31.1 70.8 5.7 85.9L144 379.6V464c0 46.4 59.2 65.5 86.6 28.6l43.8-59.1 111.9 46.2c5.9 2.4 12.1 3.6 18.3 3.6 8.2 0 16.3-2.1 23.6-6.2 12.8-7.2 21.6-20 23.9-34.5l59.4-387.2c6.1-40.1-36.9-68.8-71.5-48.9zM192 464v-64.6l36.6 15.1L192 464zm212.6-28.7l-153.8-63.5L391 169.5c10.7-15.5-9.5-33.5-23.7-21.2L155.8 332.6 48 288 464 48l-59.4 387.3z"></path></svg> garth.tarr@sydney.edu.au] </a> <a href="http://garthtarr.github.io/sydney_xaringan"> .white[<svg viewBox="0 0 512 512" style="height:1em;position:relative;display:inline-block;top:.1em;" xmlns="http://www.w3.org/2000/svg"> <path d="M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"></path></svg> garthtarr.github.io/sydney_xaringan] </a> <a href="http://twitter.com/garthtarr"> .white[<svg viewBox="0 0 512 512" style="height:1em;position:relative;display:inline-block;top:.1em;" xmlns="http://www.w3.org/2000/svg"> <path d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"></path></svg> @garthtarr] </a> <a href="http://github.com/garthtarr"> .white[<svg viewBox="0 0 496 512" style="height:1em;position:relative;display:inline-block;top:.1em;" xmlns="http://www.w3.org/2000/svg"> <path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg> @garthtarr] </a> <br><br><br> ]]