generated from inSilecoInc/workshop_R_template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
_z02_break_out.Rmd
133 lines (89 loc) · 2.65 KB
/
_z02_break_out.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
---
title: "Module 2"
output:
xaringan::moon_reader:
css: [default, rd.css, rd-font.css, "hygge"]
lib_dir: assets
seal: false
nature:
highlightStyle: dracula
countIncrementalSlides: false
beforeInit: "macros.js"
---
# Let's practice - Module 2
```{r setup_zz2, include = FALSE}
source("_setup.R")
htmltools::tagList(
xaringanExtra::use_clipboard(
button_text = "<i class=\"fa fa-clipboard\"></i>",
success_text = "<i class=\"fa fa-check\" style=\"color: #37abc8\"></i>",
),
rmarkdown::html_dependency_font_awesome()
)
xaringanExtra::use_scribble()
```
<!-- rmarkdown::render("_z02_break_out.Rmd") -->
---
# Exercise
## Context
- *The goal of the exercise is to create a GitHub repository, add and render a `.Rmd` document in `.html` and create a GitHub page*
--
- *To do this, we will use data on Palmer penguins from [Dr. Kristen Gorman](https://www.uaf.edu/cfos/people/faculty/detail/kristen-gorman.php) and the [Palmer Station, Antarctica LTER](https://pal.lternet.edu/).*
--
- *Data are available through the [`palmerpenguin`](https://github.com/allisonhorst/palmerpenguins) R package.*
```{r palmer, eval = FALSE}
library(palmerpenguins)
data(package = 'palmerpenguins')
```
---
# Exercise
## Context
```{r load, echo = FALSE}
library(palmerpenguins)
```
```{r head}
head(penguins)
```
---
# Exercise
## Task
.font90[
**1)** Create a new GitHub repository
**2)** In the new repository create a new R Markdown document named `index.Rmd`
**3)** Write a .font80[**YAML**] header including the document title, the authors, the date, and output format html
**4)** Include a single section (level 1) with the title of your choice using `# Title`
]
---
# Exercise
## Task
.font90[
**5)** Install the `palmerpenguins` R Package with `install.packages("palmerpenguins")`
**6)** Include a code chunk to add a graph of a the bill length of penguins as a function of their body mass :
````md
```{r graph, echo = FALSE, fig.height=5, fig.width=7, fig.align='center'}`r ''`
plot(x = penguins$body_mass_g,
y = penguins$bill_length_mm,
main = "Bill length as a function of body mass",
xlab = "Body mass (g)",
ylab = "Bill length (mm)",
col = "#5d2756",
bg = "#5d275699",
pch = 21)
```
````
]
---
# Exercise
## Task
.font90[
**7)** Render a `.html` document named `index.html`
**8)** Commit and push changes made to the GitHub repository
**9)** Create GitHub page from `index.html`
]
```{r, echo = FALSE, purl = FALSE}
countdown::countdown(minutes = 30, seconds = 0)
```
---
# Exercise
## Solution
Load solution file here: [`r rfa("database")`](https://github.com/inSilecoInc/learning_git_bs2)