Loading [MathJax]/jax/output/CommonHTML/jax.js
+ - 0:00:00
Notes for current slide
Notes for next slide

Image credit: TAMU Brand Guide

TAMU Presentation Template


with xaringan

Nan-Hung Hsieh

1 / 29

Let's Get Started!

2 / 29

Image credit: TAMU Brand Guide

3 / 29

Image credit: Wikimedia Commons

xaringan

/ʃæ.'riŋ.ɡæn/

4 / 29

Hello Ninja

Xaringan is developed by Yihui Xie, the software engineer in RStudio.

You can install xaringan package from R CRAN or the latest version in Github

devtools::install_github("yihui/xaringan")
5 / 29

Hello Ninja

Xaringan is developed by Yihui Xie, the software engineer in RStudio.

You can install xaringan package from R CRAN or the latest version in Github

devtools::install_github("yihui/xaringan")

You are recommended to use the RStudio IDE, but you do not have to.

  • Create a new R Markdown document from the menu File -> New File -> R Markdown -> From Template -> Ninja Presentation
6 / 29

Hello Ninja

Xaringan is developed by Yihui Xie, the software engineer in RStudio.

You can install xaringan package from R CRAN or the latest version in Github

devtools::install_github("yihui/xaringan")

You are recommended to use the RStudio IDE, 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;

7 / 29

Hello Ninja

Xaringan is developed by Yihui Xie, the software engineer in RStudio.

You can install xaringan package from R CRAN or the latest version in Github

devtools::install_github("yihui/xaringan")

You are recommended to use the RStudio IDE, 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 Addin2; "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.

[1] See #2 if you do not see the template or addin in RStudio.

8 / 29

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 research result

Right-aligned image

9 / 29

TAMU theme

The TAMU theme is based on Texas A&M University University Brand Guide. It consists of two CSS files. To use this template (the latest version), go to 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.:

---
title: "TAMU Presentation"
output:
xaringan::moon_reader:
css: ["default", "tamu.css", "tamu-fonts.css"]
nature:
highlightLines: true
---
10 / 29

TAMU theme

Not the GitHub User? No Problem!

Now, It's a built-in theme. Just simply revise the YAML:

---
output:
xaringan::moon_reader:
css: ["default", "tamu", "tamu-fonts"]
nature:
highlightLines: true
---
11 / 29

That's check some functions!

A FULL image

12 / 29

Image credit: TAMU Brand Guide

Look Good?

via GIPHY

13 / 29

Foot note

Want to write the foot note? Embed the html script <sup>1</sup> like this1:

.footnote[
[1] Y. Xie et al., xaringan: Presentation Ninja. 2018.
]

Also, this template was constructed refer to some examples2,3,4

[1] Y. Xie et al., xaringan: Presentation Ninja. 2018.
[2] R-Ladies presentation Ninja
[3] Duke color template
[4] Metropolis template

14 / 29

Font size

This is normal font size

Use .large[] to use large font

Use .small[] to use small font


Also, you can try this trick

Use .large[large[]] to use extra large font

Use .small[small[]] to use tiny font

15 / 29

Side by Side

TAM Logo Box

TAM Logo Box

16 / 29

Image size

Use .shrink[] to shrink the image

17 / 29

Image size

Use .enlarge[] to enlarge the image

18 / 29

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:

$$\theta=\frac{[L^n]}{k_d+[L]^n}$$

θ=[Ln]kd+[L]n

where

  • θ is the fraction of the receptor protein concentration that is bound to ligand.
  • [L] is the free (unbound) ligand concentration.
  • kd is the apparent dissociation constant derived from the law of mass action (the equilibrium constant for dissociation).
19 / 29

R Code

# 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"

dojutsu = c('VENI', 'VIDI', 'VICI')
grep('VI', dojutsu, value = TRUE)
## [1] "VIDI" "VICI"
20 / 29

R Plots

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())

21 / 29

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.,

knitr::kable(head(MEMSS::Theoph), format = 'html')
Subject Wt Dose Time conc
A 79.6 4.02 0.00 0.74
A 79.6 4.02 0.25 2.84
A 79.6 4.02 0.57 6.57
A 79.6 4.02 1.12 10.50
A 79.6 4.02 2.02 9.66
A 79.6 4.02 3.82 8.58
22 / 29
DT::datatable(
head(MEMSS::Theoph, 120),
fillContainer = FALSE, options = list(pageLength = 7)
)
 
23 / 29

Pharmacokinetics - Plot

xyplot(conc ~ Time| Subject, data=Theoph, xlab="Time (hr)",
auto.key = T,
ylab=expression(paste("Plasma concentration, ",mu, "M")), type="b")

24 / 29

HTML Widgets - TAMU Map

library(leaflet)
leaflet() %>% addTiles() %>% setView(lng = -96.3570, lat = 30.6116, zoom = 12)
25 / 29

Highlight Lines

  • The option highlightLines: true of nature will highlight code lines that start with *, or are wrapped in {{ }}, or have trailing comments #<<;
output:
xaringan::moon_reader:
nature:
highlightLines: true

An example using {{}}:

```{r tidy=FALSE}
if (TRUE) {
{{ message("Very important!") }}
}
```

Output:

if (TRUE) {
message("Very important!")
}
## Very important!
26 / 29

Want to learn more functions?

Click here!

27 / 29

If you want to contribute a theme to xaringan,

please read this blog post.

28 / 29

Thanks!

Slides created via the R package xaringan.

29 / 29

Let's Get Started!

2 / 29

Image credit: TAMU Brand Guide

Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow