class: title-slide left top background-image: url(data:image/png;base64,#img/tea1.jpg) background-size: cover # .white[<br>Introduction<br>To Xaringan] ## .white[Mutasim Billah] --- .center[ ## What is Xaringan? ] -- .pull-left[ .center[
<br>**JavaScript**
<br>**CSS** <img src="data:image/png;base64,#https://raw.githubusercontent.com/rstudio/hex-stickers/master/PNG/rmarkdown.png" width="20%"/><br>**R Markdown** ] ] .pull-right[ > .small[ .my-coral[The xaringan package (Xie 2022) is an R Markdown extension] .fade[based on the JavaScript library remark.js] to generate HTML5 presentations. ] <iframe src="https://slides.yihui.org/xaringan" width="100%" height="250px" data-external="1"></iframe> ] --- .center[ ## How to get Xaringan? ] ```r install.packages("xaringan") ``` .center[ <img src="data:image/png;base64,#img/naruto.gif" width="75%"/> ] --- .center[ ## Your First Presentation ] ---- .pull-left[ .center[**New File**<br>
<br>**R Markdown**<br>
<br>**From Template**<br>
<br>**Ninja Presentation**] ] .pull-right[ .center[ <img src="data:image/png;base64,#img/template.png" width="100%"/> ] ] --- .center[ ## YAML Header ] .panelset[ .panel[.panel-name[Title-Slide] ```r title: "Presentation Ninja" subtitle: "âš”<br/>with xaringan" author: "Yihui Xie" institute: "RStudio, PBC" date: "2016/12/12 (updated: `r Sys.Date()`)" ``` ] .panel[.panel-name[Output Options] ```r output: xaringan::moon_reader: lib_dir: libs # creates directory for libraries nature: highlightStyle: github # highlighting syntax for code highlightLines: true # true: enables code line highlighting countIncrementalSlides: false # false: disables counting of incremental slides ``` More options `xaringan::moon_reader` ] .panel[.panel-name[Result] <iframe src="https://slides.yihui.org/xaringan" width="100%" height="400px" data-external="1"></iframe> ] ] --- .center[ ## Anatomy of a Slide ] ```r --- class: middle right background-image: url(img/'banana.jpg') background-size: cover # Knock-Knock ## Who's there? -- ## Banana! ``` .right[.my-coral[result on next slide
]] --- class: middle right background-image: url('img/banana.jpg') background-size: cover # Knock-Knock ## Who's there? -- ## Banana! --- .center[ ## Infinite Moon Reader ] .panelset[ .panel[.panel-name[How To] .center[ `xaringan:::inf_mr()` <br> or <img src ="data:image/png;base64,#img/infinite-moon-reader.png" width="75%"/>] ] .panel[.panel-name[What is] <img src="data:image/png;base64,#img/moon-reader.gif" width="100%"/> ] ] --- background-image: url("data:image/png;base64,#img/yihui.png") background-size: contain --- class: title-slide left top background-image: url(data:image/png;base64,#img/tea1.jpg) background-size: cover # .white[Making It Better<br>] .white[
.black[some text for space]
] .white[ Allignment .black[text for space] Picture ] --- .center[ ## Align an Entire Sldie ] .left-column[ Horizontally ```r left, *center, right ``` ---- Vertically ```r top, *middle, bottom ``` ] -- .right-column[ ```r --- *class: center, middle # Slide with centered content in the middle This content is also centered and in the middle of the slide --- ``` .right[.my-coral[example on next slide
]] ] --- class: center, middle ## Slide with centered content and aligned with the middle This content is also centered and aligned with the middle of the slide --- .center[ ## Align only some Text ] .left-column[ Horizontal only ```r *.left[words] .center[words] *.right[words] ``` ] -- .right-column[ ```r --- class: center, middle # Slide with some text aligned *.left[We can start writing a sentence on the left...] *.right[...and finish it on the right.] --- ``` .right[.my-coral[example on next slide
]] ] --- class: center, middle ## Slide with some text aligned .left[We can start writing a sentence on the left...] .right[...and finish it on the right.] --- .center[ ## Column Layout ] .panelset[ .panel[.panel-name[Equal] .pull-left[ **`.pull-left[]`** class pulls content to<br>the left 47%] .pull-right[ **`.pull-right[]`** pulls content to<br>the right 47%] ] .panel[.panel-name[Narrow-Wide] .left-column[ **`.left-column[]` places content into a column 20% wide** And text is a little lighter ] .right-column[ **`.right-column[]` places content into a column 75% wide** It also has a little bit of padding on the top] ] ] --- .center[ ## Panel ] .panelset[ .panel[.panel-name[Setup] ```r xaringanExtra::use_panelset() ``` ] .panel[.panel-name[Create a Panel] ```r .panelset[ .panel[.panel-name[Name] A Panel ] .panel[.panel-name[Name] Another Panel ] ] ``` ] ] --- .center[ ## Pictures ] .panelset[ .panel[.panel-name[knitr] .pull-left[ ```r knitr::include_graphics("img/book.jpg") ``` ] .pull-right[ <img src="data:image/png;base64,#img/book.jpg" width="1372" /> ] ] .panel[.panel-name[Markdown] .pull-left[ ```markdown  ``` ] .pull-right[ ] ] ] --- class: title-slide left top background-image: url(data:image/png;base64,#img/tea1.jpg) background-size: cover ## .white[Don't Forget
<br>] .white[
.black[text for space]
] .white[ Table .black[text for space] Graph ] --- .center[ ## DT Table ]
```r DT::datatable(head(iris), fillContainer = TRUE, options = list(pageLength = 2)) ``` --- class: center ## gt Table <img src ="data:image/png;base64,#img/gt.svg" width="80%"/> --- class: center ## gt Table <img src ="data:image/png;base64,#img/gt_tbl.png" width="38%"/> --- class: center ## gt Table <iframe src="https://gt.albert-rapp.de/styling" width="100%" height="500px" data-external="1"></iframe> --- class: center ## Plot (Default) <!-- --> --- class: center ## Plot (match the theme) <!-- --> --- .center[ ## xaringanthmer ] <iframe src="https://pkg.garrickadenbuie.com/xaringanthemer/" width="100%" height="400px" data-external="1"></iframe> --- .center[ ## Plot with xaringanthemer ] ```r library(ggplot2) (g <- ggplot(mpg) + aes(hwy, cty, color = class) + geom_point()) ``` .center[ **Basic Plot with Default Theme** ] ```r g + xaringanthemer::theme_xaringan(text_font_size = 16, title_font_size = 18) + ggtitle("A Plot About Cars") ``` .center[ **Plot with Matched Theme(theme defined by `xaringan-themer.css`)** ] --- class: center middle .center[ <img src="data:image/png;base64,#img/jerry.gif" width="80%"/> ]