generated from jhudsl/OTTR_Template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
02-chapter_of_course.Rmd
127 lines (75 loc) · 3 KB
/
02-chapter_of_course.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
*If you haven't yet read the getting started Wiki pages; [start there](https://github.com/jhudsl/DaSL_Course_Template_Bookdown/wiki/Getting-started)
Every chapter needs to start out with this chunk of code:
```{r, include = FALSE}
ottrpal::set_knitr_image_path()
```
## Learning Objectives
*Every chapter also needs Learning objectives that will look like this:
This chapter will cover:
- {You can use https://tips.uark.edu/using-blooms-taxonomy/ to define some learning objectives here}
- {Another learning objective}
## Libraries
For this chapter, we'll need the following packages attached:
*Remember to add [any additional packages you need to your course's own docker image](https://github.com/jhudsl/DaSL_Course_Template_Bookdown/wiki/Using-Docker#starting-a-new-docker-image).
```{r}
library(magrittr)
```
# Topic of Section
You can write all your text in sections like this!
## Subtopic
Here's a subheading and some text in this subsection!
### Code examples
You can demonstrate code like this:
```{r}
output_dir <- file.path("resources", "code_output")
if (!dir.exists(output_dir)) {
dir.create(output_dir)
}
```
And make plots too:
```{r}
hist_plot <- hist(iris$Sepal.Length)
```
You can also save these plots to file:
```{r}
png(file.path(output_dir, "test_plot.png"))
hist_plot
dev.off()
```
### Image example
How to include a Google slide. It's simplest to use the `leanbuild` package:
```{r, fig.align='center', echo = FALSE, fig.alt= "Major point!! example image"}
ottrpal::include_slide("https://docs.google.com/presentation/d/1YmwKdIy9BeQ3EShgZhvtb3MgR8P6iDX4DfFD65W_gdQ/edit#slide=id.gcc4fbee202_0_141")
```
But if you have the slide or some other image locally downloaded you can also use html like this:
<img src="resources/images/02-chapter_of_course_files/figure-html//1YmwKdIy9BeQ3EShgZhvtb3MgR8P6iDX4DfFD65W_gdQ_gcc4fbee202_0_141.png" title="Major point!! example image" alt="Major point!! example image" style="display: block; margin: auto;" />
### Video examples
You can use `knitr::include_url()` like this:
```{r}
knitr::include_url("https://www.youtube.com/embed/VOCYL-FNbr0")
```
OR this works:
<iframe src="https://www.youtube.com/embed/VOCYL-FNbr0" width="672" height="400px"></iframe>
### File examples
You can again use simple markdown syntax to just include a link to a file like so:
[A file](https://www.tandfonline.com/doi/pdf/10.1080/26939169.2022.2118646).
Alternatively you can embed files like PDFs.
### Links to websites
Examples of including a website link.
This works:
```{r, fig.align="center"}
knitr::include_url("https://yihui.org")
```
OR this:
![Another link](https://yihui.org)
OR this:
<iframe src="https://yihui.org" width="672" height="400px"></iframe>
### Citation examples
We can put citations at the end of a sentence like this [@rmarkdown2021].
Or multiple citations [@rmarkdown2021, @Xie2018].
but they need a ; separator [@rmarkdown2021; @Xie2018].
In text, we can put citations like this @rmarkdown2021.
## Print out session info
```{r}
sessionInfo()
```