-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtamu-slide-template.Rmd
381 lines (249 loc) · 8.1 KB
/
tamu-slide-template.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
---
title: "TAMU Presentation Template"
subtitle: "⚕<br/>with xaringan"
author: "Nan-Hung Hsieh"
date: ""
output:
xaringan::moon_reader:
css: ["default", "tamu.css", "tamu-fonts.css"]
nature:
highlightLines: true
---
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)
---
```{r setup, include=FALSE}
options(htmltools.dir.version = FALSE)
library(ggplot2)
library(MEMSS)
library(lattice)
```
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 comment='#'}
# a boring regression
fit = lm(dist ~ 1 + speed, data = cars)
coef(summary(fit))
```
### Use the quote? No problem!
> "I came; I saw; I conquered"
```{r}
dojutsu = c('VENI', 'VIDI', 'VICI')
grep('VI', dojutsu, value = TRUE)
```
---
# R Plots
```{r, fig.height=3, dev='svg'}
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())
```
---
# 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')
```
---
```{r eval=require('DT'), tidy=FALSE}
DT::datatable(
head(MEMSS::Theoph, 120),
fillContainer = FALSE, options = list(pageLength = 7)
)
```
---
# Pharmacokinetics - Plot
```{r, fig.height=4.5, dev='svg'}
xyplot(conc ~ Time| Subject, data=Theoph, xlab="Time (hr)",
auto.key = T,
ylab=expression(paste("Plasma concentration, ",mu, "M")), type="b")
```
---
# HTML Widgets - TAMU Map
```{r out.width='100%', fig.height=6, eval=require('leaflet')}
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 ''````{r tidy=FALSE}
if (TRUE) {
*{{ message("Very important!") }}
}
```
]
.pull-right[
Output:
```{r tidy=FALSE}
if (TRUE) {
{{ message("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).