-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLesson_4.html
More file actions
207 lines (154 loc) · 4.91 KB
/
Lesson_4.html
File metadata and controls
207 lines (154 loc) · 4.91 KB
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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<script src="https://kit.fontawesome.com/53bd508d27.js" crossorigin="anonymous"></script>
<title>CMA: Introduction to Git</title>
<link rel="stylesheet" href="revealjs/dist/reset.css">
<link rel="stylesheet" href="revealjs/dist/reveal.css">
<link rel="stylesheet" href="revealjs/dist/theme/black.css">
<!-- CSS Plots (https://github.com/asciimoo/cssplot/)-->
<link media="all" rel="stylesheet" type="text/css" href="cssplot/build/cssplot.full.css" />
<!-- Theme used for syntax highlighted code -->
<link rel="stylesheet" href="revealjs/plugin/highlight/monokai.css">
<style>
.graph {
height: 200px;
width: 500px;
}
.svg-hline {
stroke: #fefce2;
stroke-width: 1;
}
.svg-circle {
stroke: #fefce2;
fill: #8a8e96;
}
.svg-text {
font-family: Mono;
font-size: 20px;
fill: #fefce2;
dominant-baseline: middle
}
.svg-small {
font-size: 15px;
}
.svg-gray {
fill: 2A9D8F
}
.highlight {
color: #E76F51
}
.svg-rect {
fill: red;
stroke-width: 5;
opacity: 0.3;
}
.reveal .slides section .fragment.visible.svg-rect {
opacity: 0.3;
}
.left {
style: "text-align: left"
}
</style>
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<h1 class="r-fit-text">Feedback Exercise 2</h1>
</section>
<section>
Using <code>mutate</code>
<p class="left">instead of writing: </p>
<pre><code data-trim class="r" data-line-numbers="">
wildschwein <- wildschwein |>
group_by(TierID) |>
mutate(timelag_sec = as.numeric(...) |>
mutate(timelag_min = as.numeric(....) |>
mutate(timelag_hours = as.numeric(...)
</code></pre>
<div class="fragment">
<p class="left">you can write this:</p>
<pre><code data-trim class="r" data-line-numbers="">
wildschwein <- wildschwein |>
group_by(TierID) |>
mutate(
timelag_sec = as.numeric(....),
timelag_min=as.numeric(...),
timelag_hours=as.numeric(...)
)
</code></pre>
</div>
</section>
<section>
<p class="left">using <code>summarize()</code> with <code>sf</code> objects</p>
<ul style="font-size: xx-large">
<li class="fragment"><code>sf</code> objects contain geometries (e.g. <em>Points</em> for our
Wildboar data) </li>
<li class="fragment"><code>summarize()</code> will also try to summarize these geometries (with a
<code>union</code>)</li>
<li class="fragment"> this is often not what you intend (especially in E2)</li>
<li class="fragment"> the operation usually takes a long time</li>
<li class="fragment"> you can prevent this by dropping the geometry beforehand</li>
</ul>
<pre class="fragment"><code data-trim class="r" data-line-numbers="">
wildschwein_BE |>
st_drop_geometry() |> #<- removes the geometry column
group_by(TierID) |>
summarise(mindate = min(DatetimeUTC))
</code></pre>
</section>
<section>
<h3>Housekeeping</h3>
<p class="left">When working with Github, we recommend following housekeeping practices:</p>
</section>
<section>
<h3>Good</h3>
<p class="left"> Close your issues after you have solved them. </p>
<img data-src="images/gh_good.jpg" style="width:80%">
</section>
<section>
<h3>Better</h3>
<p class="left">Close your issues <em>with a comment.</em></p>
<img data-src="images/gh_better.jpg" style="width:80%">
</section>
<section>
<h3>Pro</h3>
<p class="left">Reference the issue in your commit message</p>
<pre class="fragment"><code data-trim class="txt" data-line-numbers="">
Added missing csv files, this fixes issue #3
</code></pre>
<img data-src="images/gh_pro_crop.jpg" style="width:80%" class="fragment">
</section>
<section>
<h3>Peer Feedback E3</h3>
</section>
<section>
<h3>Reminder:</h3>
<ul>
<li class="fragment">Submit the Github URL to E3</li>
<li class="fragment">Submit the Github URL to your semester project</li>
<li class="fragment">Choose a slot for a coaching session on <a href="https://moodle.zhaw.ch/course/view.php?id=3149">moodle</a></li>
</ul>
</section>
</div>
</div>
<script src="revealjs/dist/reveal.js"></script>
<script src="revealjs/plugin/notes/notes.js"></script>
<script src="revealjs/plugin/markdown/markdown.js"></script>
<script src="revealjs/plugin/highlight/highlight.js"></script>
<script>
// More info about initialization & config:
// - https://revealjs.com/initialization/
// - https://revealjs.com/config/
Reveal.initialize({
hash: true,
mouseWheel: true,
// Learn about plugins: https://revealjs.com/plugins/
plugins: [RevealMarkdown, RevealHighlight, RevealNotes]
});
</script>
</body>
</html>