class: center, middle, inverse, title-slide # TAMU Presentation Template ## ⚕
with xaringan ### Nan-Hung Hsieh --- class: inverse, center, middle background-image: url(https://i.imgur.com/VCyLJx2.png) background-size: contain # Let's Get Started! ??? Image credit: [TAMU Brand Guide](https://brandguide.tamu.edu/images/brand-examples/ROI.jpg) --- class: inverse, center, middle background-image: url(https://upload.wikimedia.org/wikipedia/commons/b/be/Sharingan_triple.svg) ??? Image credit: [Wikimedia Commons](https://commons.wikimedia.org/wiki/File:Sharingan_triple.svg) --- class: inverse, center, middle # xaringan ### /ʃæ.'riŋ.ɡæn/ --- # Hello **Ninja** Xaringan is developed by Yihui Xie, the software engineer in [RStudio](https://www.rstudio.com). You can install **xaringan** package from R CRAN or the latest version in [Github](https://github.com/yihui/xaringan) ```r devtools::install_github("yihui/xaringan") ``` -- You are recommended to use the [RStudio IDE](https://www.rstudio.com/products/rstudio/), but you do not have to. - Create a new R Markdown document from the menu `File -> New File -> R Markdown -> From Template -> Ninja Presentation` -- - Click the `Knit` button to compile it; -- - or use the [RStudio Addin](https://rstudio.github.io/rstudioaddins/)<sup>2</sup>; "Infinite Moon Reader" to live preview the slides (every time you update and save the Rmd document, the slides will be automatically reloaded in RStudio Viewer. .footnote[ [1] See [#2](https://github.com/yihui/xaringan/issues/2) if you do not see the template or addin in RStudio. ] --- # Why xaringan? - **Free** and Open Source (Slides are composed in R Markdown) - Version control - Portable and easily share (Web-based slide) - Easily print to PDF from Chrome - [**Repoducibe**](Reproducibility) research result .right[![Right-aligned image](http://phdcomics.com/comics/archive/phd031214s.gif)] --- layout: true background-image: url(https://brandguide.tamu.edu/downloads/logos/TAM-Logo.svg) background-size: 100px background-position: 99% 1% # TAMU theme --- # The TAMU theme is based on [Texas A&M University University Brand Guide](https://brandguide.tamu.edu/). It consists of two CSS files. To use this template (the latest version), go to [xaringan-tamu](https://github.com/nanhung/xaringan-tamu) github repo and clone it. You only need to put your slide file (`*.Rmd`) and the template css (`tamu.css`, `tamu-fonts.css`) in the same folder. Then, use it in the YAML metadata, e.g.: ```yaml --- title: "TAMU Presentation" output: xaringan::moon_reader: * css: ["default", "tamu.css", "tamu-fonts.css"] nature: highlightLines: true --- ``` --- Not the GitHub User? **No Problem**! Now, It's a built-in theme. Just simply revise the YAML: ```yaml --- output: xaringan::moon_reader: * css: ["default", "tamu", "tamu-fonts"] nature: highlightLines: true --- ``` --- layout: false # That's check some **functions**! A **FULL** image ![](https://brandguide.tamu.edu/assets/img/landing-page/ourbrand.jpg) ??? Image credit: [TAMU Brand Guide](https://brandguide.tamu.edu/assets/img/landing-page/ourbrand.jpg) --- # **Look Good?** <center><iframe src="https://giphy.com/embed/3ohzdP7FK3kyYgdWes" width="480" height="271" frameBorder="0" class="giphy-embed" allowFullScreen></iframe><p><a href="https://giphy.com/gifs/tamu-high-five-texas-am-3ohzdP7FK3kyYgdWes">via GIPHY</a></p></center> --- # Foot note Want to write the foot note? Embed the html script `<sup>1</sup>` like this<sup>1</sup>: ```r .footnote[ [1] Y. Xie et al., xaringan: Presentation Ninja. 2018. ] ``` Also, this template was constructed refer to some examples<sup>2,3,4</sup> .footnote[ [1] Y. Xie et al., xaringan: Presentation Ninja. 2018. [2] [R-Ladies presentation Ninja](https://alison.rbind.io/slides/rladies-demo-slides.html) [3] [Duke color template](https://www.johnlittle.info/project/custom/slide-template/duke_slide_template.html) [4] [Metropolis template](https://pat-s.github.io/files/xaringan-metropolis.html) ] --- # Font size This is normal font size Use `.large[]` to use .large[large font] Use `.small[]` to use .small[small font] <br/> Also, you can try this trick Use `.large[large[]]` to use .large[.large[**extra large font**]] Use `.small[small[]]` to use .small[.small[**tiny font**]] --- class: center # Side by Side .pull-left[ ### TAM Logo Box <img src="https://brandguide.tamu.edu/assets/downloads/logos/TAM-LogoBox.png" width="40%"> ### TAM Logo <img src="https://brandguide.tamu.edu/assets/downloads/logos/TAM-Logo.png" width="40%"> ] .pull-right[ ### TAM Logo <img src="https://brandguide.tamu.edu/assets/downloads/logos/TAM-Logo.png" width="40%"> ### TAM Logo Box <img src="https://brandguide.tamu.edu/assets/downloads/logos/TAM-LogoBox.png" width="40%"> ] --- # Image size Use `.shrink[]` to shrink the image .shrink[ ![](https://brandguide.tamu.edu/assets/img/landing-page/ourbrand.jpg) ] --- # Image size Use `.enlarge[]` to enlarge the image .enlarge[ ![](https://brandguide.tamu.edu/assets/img/landing-page/ourbrand.jpg) ] --- # Math Expressions You can write LaTeX math expressions inside a pair of dollar signs. You can use the display style with double dollar signs. This is the [Hill equation](https://en.wikipedia.org/wiki/Hill_equation_(biochemistry): ```r $$\theta=\frac{[L^n]}{k_d+[L]^n}$$ ``` `$$\theta=\frac{[L^n]}{k_d+[L]^n}$$` where - `\(\theta\)` is the fraction of the receptor protein concentration that is bound to ligand. - `\([L]\)` is the free (unbound) ligand concentration. - `\(k_d\)` is the apparent dissociation constant derived from the law of mass action (the equilibrium constant for dissociation). --- # R Code ```r # a boring regression fit = lm(dist ~ 1 + speed, data = cars) coef(summary(fit)) ``` ``` # Estimate Std. Error t value Pr(>|t|) # (Intercept) -17.579095 6.7584402 -2.601058 1.231882e-02 # speed 3.932409 0.4155128 9.463990 1.489836e-12 ``` ### Use the quote? No problem! > "I came; I saw; I conquered" ```r dojutsu = c('VENI', 'VIDI', 'VICI') grep('VI', dojutsu, value = TRUE) ``` ``` ## [1] "VIDI" "VICI" ``` --- # R Plots ```r ggplot(NULL, aes(x = 1, y = 1)) + annotate("text", 1, 1, label = 'GiG\'EM AGGIES!', color = "#500000", fontface = "bold", size = 12)+ theme(axis.title = element_blank(), axis.ticks = element_blank(), axis.text = element_blank()) ``` ![](tamu-slide-template_files/figure-html/unnamed-chunk-3-1.svg)<!-- --> --- # Pharmacokinetics - Tables If you want to generate a table, make sure it is in the HTML format (instead of Markdown or other formats), e.g., ```r knitr::kable(head(MEMSS::Theoph), format = 'html') ``` <table> <thead> <tr> <th style="text-align:left;"> Subject </th> <th style="text-align:right;"> Wt </th> <th style="text-align:right;"> Dose </th> <th style="text-align:right;"> Time </th> <th style="text-align:right;"> conc </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> A </td> <td style="text-align:right;"> 79.6 </td> <td style="text-align:right;"> 4.02 </td> <td style="text-align:right;"> 0.00 </td> <td style="text-align:right;"> 0.74 </td> </tr> <tr> <td style="text-align:left;"> A </td> <td style="text-align:right;"> 79.6 </td> <td style="text-align:right;"> 4.02 </td> <td style="text-align:right;"> 0.25 </td> <td style="text-align:right;"> 2.84 </td> </tr> <tr> <td style="text-align:left;"> A </td> <td style="text-align:right;"> 79.6 </td> <td style="text-align:right;"> 4.02 </td> <td style="text-align:right;"> 0.57 </td> <td style="text-align:right;"> 6.57 </td> </tr> <tr> <td style="text-align:left;"> A </td> <td style="text-align:right;"> 79.6 </td> <td style="text-align:right;"> 4.02 </td> <td style="text-align:right;"> 1.12 </td> <td style="text-align:right;"> 10.50 </td> </tr> <tr> <td style="text-align:left;"> A </td> <td style="text-align:right;"> 79.6 </td> <td style="text-align:right;"> 4.02 </td> <td style="text-align:right;"> 2.02 </td> <td style="text-align:right;"> 9.66 </td> </tr> <tr> <td style="text-align:left;"> A </td> <td style="text-align:right;"> 79.6 </td> <td style="text-align:right;"> 4.02 </td> <td style="text-align:right;"> 3.82 </td> <td style="text-align:right;"> 8.58 </td> </tr> </tbody> </table> --- ```r DT::datatable( head(MEMSS::Theoph, 120), fillContainer = FALSE, options = list(pageLength = 7) ) ```
--- # Pharmacokinetics - Plot ```r xyplot(conc ~ Time| Subject, data=Theoph, xlab="Time (hr)", auto.key = T, ylab=expression(paste("Plasma concentration, ",mu, "M")), type="b") ``` ![](tamu-slide-template_files/figure-html/unnamed-chunk-6-1.svg)<!-- --> --- # HTML Widgets - TAMU Map ```r library(leaflet) leaflet() %>% addTiles() %>% setView(lng = -96.3570, lat = 30.6116, zoom = 12) ```
--- # Highlight Lines - The option `highlightLines: true` of `nature` will highlight code lines that start with `*`, or are wrapped in `{{ }}`, or have trailing comments `#<<`; ```yaml output: xaringan::moon_reader: nature: highlightLines: true ``` .pull-left[ An example using `{{}}`: ```{r tidy=FALSE} if (TRUE) { *{{ message("Very important!") }} } ``` ] .pull-right[ Output: ```r if (TRUE) { * message("Very important!") } ``` ``` ## Very important! ``` ] --- class: middle # Want to learn more functions? # [Click here!](https://slides.yihui.name/xaringan/incremental.html) --- class: middle # If you want to contribute a theme to **xaringan**, # please read [this blog post](https://yihui.name/en/2017/10/xaringan-themes). --- layout: false class: inverse, center, middle # **Thanks!** Slides created via the R package [**xaringan**](https://github.com/yihui/xaringan).