This repository has been archived by the owner on Jan 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathrmarkdown.html
271 lines (195 loc) · 10.5 KB
/
rmarkdown.html
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
<!DOCTYPE html>
<html>
<head>
<title>Rmarkdown</title>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="generator" content="pandoc" />
<meta name="date" content="2016-01-20" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="stylesheet" media="all" href="libs/ioslides-13.5.1/fonts/fonts.css">
<link rel="stylesheet" media="all" href="libs/ioslides-13.5.1/theme/css/default.css">
<link rel="stylesheet" media="only screen and (max-device-width: 480px)" href="libs/ioslides-13.5.1/theme/css/phone.css">
<base target="_blank">
<script type="text/javascript">
var SLIDE_CONFIG = {
// Slide settings
settings: {
title: 'Rmarkdown',
subtitle: 'Environmental Informatics',
useBuilds: true,
usePrettify: true,
enableSlideAreas: true,
enableTouch: true,
},
// Author information
presenters: [
{
name: '<span class="citation">@bbest</span>' ,
company: '',
gplus: '',
twitter: '',
www: '',
github: ''
},
]
};
</script>
<style type="text/css">
b, strong {
font-weight: bold;
}
em {
font-style: italic;
}
slides > slide {
-webkit-transition: all 0.4s ease-in-out;
-moz-transition: all 0.4s ease-in-out;
-o-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
}
.auto-fadein {
-webkit-transition: opacity 0.6s ease-in;
-webkit-transition-delay: 0.4s;
-moz-transition: opacity 0.6s ease-in 0.4s;
-o-transition: opacity 0.6s ease-in 0.4s;
transition: opacity 0.6s ease-in 0.4s;
opacity: 0;
}
</style>
</head>
<body style="opacity: 0">
<slides class="layout-widescreen">
<slide class="title-slide segue nobackground">
<!-- The content of this hgroup is replaced programmatically through the slide_config.json. -->
<hgroup class="auto-fadein">
<h1 data-config-title><!-- populated from slide_config.json --></h1>
<h2 data-config-subtitle><!-- populated from slide_config.json --></h2>
<p data-config-presenter><!-- populated from slide_config.json --></p>
<p style="margin-top: 6px; margin-left: -2px;">2016-01-20</p>
</hgroup>
</slide>
<slide class=''><hgroup><h2>Teaching Method per Module</h2></hgroup><article id="teaching-method-per-module">
<p>Follow a <strong>schedule</strong> for the 3 hour class with the following elements per module:</p>
<ol class = 'build'>
<li><p><strong>Lecture</strong> to <em><strong>introduce</strong></em>: watch presentation</p></li>
<li><p><strong>Demo</strong> to <em><strong>show</strong></em>: watch instructor use RStudio to get overall idea</p></li>
<li><p><strong>Exercise</strong> to <em><strong>learn</strong></em>: do it yourself, individually, with given material</p></li>
<li><p><strong>Group</strong> to <em><strong>apply</strong></em>: apply new technique to your group project (ie specific data and question)</p></li>
</ol>
</article></slide><slide class=''><hgroup><h2>Real Skills Learned</h2></hgroup><article id="real-skills-learned">
<ul class = 'build'>
<li><p>Technology changes rapidly</p></li>
<li><p>Yes, you're learning about tools and libraries specific to R, but the concepts are applicable to most any programming language</p></li>
<li><p>The real skill learned here is <strong>critical thinking</strong> / <strong>problem solving</strong> / <strong>googling</strong> to figure out how to get your science done!</p></li>
<li><p><img height=400 src="img/science-the-shit-out-of-this.jpg"/></p></li>
</ul>
</article></slide><slide class=''><hgroup><h2>Flipped Classroom</h2></hgroup><article id="flipped-classroom">
<p>Teacher's role: "Sage on the Stage" -> "Guide on the Side"</p>
<img src='img/flipped-classroom.png' title=''/>
<p>Inspired by <a href='http://www.datacarpentry.org/semester-biology/about/flipped-classes/' title=''>Data Carpentry for Biologists</a>, created by <a href='https://www.knewton.com/infographics/flipped-classroom/' title=''>Knewton</a></p>
</article></slide><slide class='segue dark nobackground'><hgroup class = 'auto-fadein'><h2>Rmarkdown</h2></hgroup><article id="rmarkdown">
</article></slide><slide class=''><hgroup><h2>Inspiration</h2></hgroup><article id="inspiration" class="flexbox vcenter">
<div align="center">
<img src="img/Gandrud2013_ReproducibleResearchRstudio_cover.png" height=500></div>
<p>Gandrud (2013) <a href='http://christophergandrud.github.io/RepResR-RStudio/' title=''>Reproducible Research with R and Rstudio</a></p>
</article></slide><slide class=''><hgroup><h2>What is Rmarkdown?</h2></hgroup><article id="what-is-rmarkdown">
<p>Rmarkdown = R + markdown</p>
<ul class = 'build'>
<li><em><strong>input</strong></em> simple text:
<ul class = 'build'>
<li><strong>markdown</strong>: simple formatting of text (bold, links, headers, images, …)</li>
<li><strong>R</strong>: execute chunks of code (figures, tables…)</li>
</ul></li>
<li><em><strong>output</strong></em> various formats:
<ul class = 'build'>
<li><strong>html</strong>: share on public website</li>
<li><strong>pdf</strong>: polished publication</li>
<li><strong>docx</strong>: share with co-authors to track changes</li>
</ul></li>
</ul>
</article></slide><slide class=''><hgroup><h2>First Example of Rmarkdown</h2></hgroup><article id="first-example-of-rmarkdown">
<div align="center">
<img src="img/rmd_first.png" height=550></div>
<p>In RStudio, menu File > New File > Rmarkdown… Document, HTML. Knit HMTL button to render the right.</p>
</article></slide><slide class=''><hgroup><h2>Markdown</h2></hgroup><article id="markdown">
<p>"easy" HTML</p>
<div align="center">
<img src="img/rmd_markdownOverview.png" height=400></div>
<p>Github renders (with <a href='https://help.github.com/articles/github-flavored-markdown' title=''>flavor</a>), eg README.md</p>
</article></slide><slide class=''><hgroup><h2>R in Rmarkdown - Chunk</h2></hgroup><article id="r-in-rmarkdown---chunk">
<p>Surround code with 3 backticks with <code>{r}</code> in first line</p>
<div align="center">
<img src="img/markdownChunk.png" height=550></div>
</article></slide><slide class=''><hgroup><h2>R in Rmarkdown - Inline</h2></hgroup><article id="r-in-rmarkdown---inline">
<p>Surround code in single backticks</p>
<p><code>pi=`r pi`</code> evaluates to "pi=3.1415927"</p>
</article></slide><slide class=''><hgroup><h2>Equations in Rmarkdown - Chunk</h2></hgroup><article id="equations-in-rmarkdown---chunk">
<p>Uses <a href='https://en.wikibooks.org/wiki/LaTeX' title=''>Latex</a> markup language for equations as input. Outputs using <a href='https://www.mathjax.org/' title=''>MathJax</a> JavaScript library for HTML output, native for PDF.</p>
<pre >$$
\frac{1}{n} \sum_{i=i}^{n} x_{i}
$$</pre>
<p>\[
\frac{1}{n} \sum_{i=i}^{n} x_{i}
\]</p>
</article></slide><slide class=''><hgroup><h2>Equations in Rmarkdown - Inline</h2></hgroup><article id="equations-in-rmarkdown---inline">
<p><code>The Arithmetic mean is equal to $\frac{1}{n} \sum_{i=i}^{n} x_{i}$, or the summation of n numbers divided by n.</code></p>
<p>The Arithmetic mean is equal to \(\frac{1}{n} \sum_{i=i}^{n} x_{i}\), or the summation of n numbers divided by n.</p>
</article></slide><slide class=''><hgroup><h2>Github Friendly</h2></hgroup><article id="github-friendly">
<ul class = 'build'>
<li><p>Rmarkdown (*.Rmd) renders as markdown (*.md)</p></li>
<li><p>easy to see change in simple text files (vs binary / proprietary formats)</p></li>
</ul>
</article></slide><slide class=''><hgroup><h2>Demo</h2></hgroup><article id="demo">
<p>Rstudio: menu File > New File > Rmarkdown… Document, HTML. Knit HMTL button.</p>
<ul class = 'build'>
<li><a href='https://github.com/ucsb-bren/env-info/blob/gh-pages/wk02_program/first.Rmd' title=''>first.<strong>Rmd</strong></a></li>
<li><a href='https://ucsb-bren.github.io/env-info/wk02_program/first.html' title=''>first.<strong>html</strong></a></li>
</ul>
</article></slide><slide class=''><hgroup><h2>Help</h2></hgroup><article id="help">
<ul class = 'build'>
<li>Rstudio menu Help > <a href='http://rmarkdown.rstudio.com/authoring_basics.html' title=''>Markdown Quick Reference</a></li>
<li><a href='../refs/cheatsheets/rmarkdown-cheatsheet.pdf' title=''>R Markdown Cheat Sheet</a></li>
<li><a href='../refs/cheatsheets/rmarkdown-reference.pdf' title=''>R Markdown Reference Guide</a></li>
<li><a href='https://guides.github.com/features/mastering-markdown/' title=''>Mastering Markdown · GitHub Guides</a></li>
</ul>
</article></slide><slide class=''><hgroup><h2>Further Resources</h2></hgroup><article id="further-resources">
<ul class = 'build'>
<li><a href='http://rmarkdown.rstudio.com/' title=''>rmarkdown.rstudio.com</a>: authoritative reference site</li>
<li><a href='https://github.com/bbest/rmarkdown-example' title=''>bbest/rmarkdown-example</a>: example of full manuscript (figures, tables, captions, references using Zotero) as html, pdf, docx</li>
</ul></article></slide>
<slide class="backdrop"></slide>
</slides>
<script src="libs/ioslides-13.5.1/js/modernizr.custom.45394.js"></script>
<script src="libs/ioslides-13.5.1/js/prettify/prettify.js"></script>
<script src="libs/ioslides-13.5.1/js/prettify/lang-r.js"></script>
<script src="libs/ioslides-13.5.1/js/prettify/lang-yaml.js"></script>
<script src="libs/ioslides-13.5.1/js/hammer.js"></script>
<script src="libs/ioslides-13.5.1/js/slide-controller.js"></script>
<script src="libs/ioslides-13.5.1/js/slide-deck.js"></script>
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function () {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
document.getElementsByTagName("head")[0].appendChild(script);
})();
</script>
<!-- map slide visiblity events into shiny -->
<script>
(function() {
if (window.jQuery) {
window.jQuery(document).on('slideleave', function(e) {
window.jQuery(e.target).trigger('hidden');
});
window.jQuery(document).on('slideenter', function(e) {
window.jQuery(e.target).trigger('shown');
});
}
})();
</script>
</body>
</html>