-
Notifications
You must be signed in to change notification settings - Fork 15
/
index.html
3027 lines (2054 loc) · 58.9 KB
/
index.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
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
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="" xml:lang="">
<head>
<title>Sharing on Short Notice</title>
<meta charset="utf-8" />
<meta name="author" content="Alison Hill" />
<meta name="date" content="2020-03-31" />
<link href="libs/remark-css/default.css" rel="stylesheet" />
<meta name="description" content="How to Get Your Teaching Materials Online with R Markdown"/>
<meta name="generator" content="xaringan and remark.js"/>
<meta name="github-repo" content="rstudio-education/sharing-short-notice"/>
<meta name="twitter:title" content="Sharing on Short Notice"/>
<meta name="twitter:description" content="How to Get Your Teaching Materials Online with R Markdown"/>
<meta name="twitter:url" content="https://rstd.io/sharing"/>
<meta name="twitter:image:src" content="https://repository-images.githubusercontent.com/248553842/408a8d80-7363-11ea-96ae-d04b664002df"/>
<meta name="twitter:image:alt" content="The first slide features a flying machine"/>
<meta name="twitter:card" content="summary_large_image"/>
<meta name="og:title" content="Sharing on Short Notice"/>
<meta name="og:description" content="How to Get Your Teaching Materials Online with R Markdown"/>
<meta name="og:url" content="https://rstd.io/sharing"/>
<meta name="og:image" content="https://repository-images.githubusercontent.com/248553842/408a8d80-7363-11ea-96ae-d04b664002df"/>
<meta name="og:image:alt" content="The first slide features a flying machine"/>
<meta name="og:type" content="website"/>
<meta name="og:locale" content="en_US"/>
<link href="libs/font-awesome/css/fontawesome-all.min.css" rel="stylesheet" />
<link rel="stylesheet" href="assets/css/my-theme.css" type="text/css" />
<link rel="stylesheet" href="assets/css/my-fonts.css" type="text/css" />
</head>
<body>
<textarea id="source">
layout: true
<a class="footer-link" href="https://rstudio-education.github.io/sharing-short-notice/">rstd.io/sharing</a>
---
class: title-slide, center, bottom
# Sharing on Short Notice
## How to Get Your Teaching Materials Online with R Markdown
### Alison Hill &#183; Desirée De Leon
???
Welcome to the webinar on sharing on short notice
Where we'll show you how to get your teaching materials online with R Markdown.
---
name: clouds
class: center, middle
background-image: url(images/Clouds.jpg)
background-size: cover
---
template: clouds
## .big-text[Hello.]
???
So hello- we're so happy you could join us today.
---
name: clouds2
background-image: url(images/Clouds2.jpg)
background-size: cover
---
template: clouds2
class: middle, center
.pull-left[
### Alison Hill
<img style="border-radius: 50%;" src="https://conf20-intro-ml.netlify.com/authors/alison/avatar.jpg" width="150px"/>
[<i class="fab fa-github "></i> @apreshill](https://github.com/apreshill)
[<i class="fab fa-twitter "></i> @apreshill](https://twitter.com/apreshill)
]
???
My name is Alison Hill, and I'm a data scientist and professional educator at RStudio.
--
.pull-right[
### Desirée De Leon
<img style="border-radius: 50%;" src="https://conf20-intro-ml.netlify.com/authors/desiree/avatar.jpg" width="150px"/>
[<i class="fab fa-github "></i> @dcossyleon](https://github.com/dcossyleon)
[<i class="fab fa-twitter "></i> @dcossyle](https://twitter.com/dcossyle)
]
???
And I'm Desirée De Leon. I interned with Alison last summer at RStudio on the education team.
---
template: clouds2
class: middle, center
.pull-left[
### Alison Hill
<img src="https://media.giphy.com/media/WTEdeICMGkw91sHEy1/giphy.gif" style="width: 82.07%; display: block; margin: 1 auto;">
[<i class="fab fa-github "></i> @apreshill](https://github.com/apreshill)
[<i class="fab fa-twitter "></i> @apreshill](https://twitter.com/apreshill)
]
.pull-right[
### Desirée De Leon
<img src="https://media.giphy.com/media/hoqxB6HRhWtySSjO2S/giphy.gif">
[<i class="fab fa-github "></i> @dcossyleon](https://github.com/dcossyleon)
[<i class="fab fa-twitter "></i> @dcossyle](https://twitter.com/dcossyle)
]
???
And even though we don't have a video feed in this webinar, we promise we are real live humans who are stuck at home right now just like you all, sitting in front our computers.
---
class: freight-slide, center, middle, inverse
# .shadow-text[We ship a lot of websites.]
???
I am a developmental psychologist
Desirée is a neuroscientist
Neither of us is a web developer
But we both ship a lot of websites for teaching data science.
Here are just a few of them.
---
class: freight-slide, center, middle, inverse
# .shadow-text[We ship a lot of websites.]
http://bit.ly/giraffe-stats
https://education.rstudio.com/
https://bookdown.org/yihui/blogdown/
https://stat545.com/
https://conf20-intro-ml.netlify.com/
https://summer-of-blogdown.netlify.com/
https://apreshill.github.io/data-vis-labs-2018/
???
If you type the short link on the bottom right of this slide into your browser right now, you'll be able to follow along.
All of these links are clickable from the slides.
Each site was built using R Markdown, with different tools chosen depending on what we needed.
---
template: clouds
# Who are you?
???
So that's us. Who are you?
---
class: middle, center
<div class="flex" style="margin: 0 1em;">
<div class="column">
<h3> You're an educator <h3>
<img src="images/rawpixel/educator.jpg" style="width: 100%;">
</div>
???
Here's who we think you are...
You're an educator
--
<div class="column"style="margin: 0 1em;">
<h3> You've got lots of .Rmds </h3>
<img src="images/rmd-buddy.jpg" style="width: 100%;">
</div>
???
You have R Markdown files for teaching...
---
class: middle, center
<div class="flex" style="margin: 0 1em;">
<div class="column">
<h3> You're an educator </h3>
<img src="images/rawpixel/educator.jpg" style="width: 100%;">
</div>
<div class="column"style="margin: 0 1em;">
<h3> You've got lots of .Rmds </h3>
<img src="images/rmd-buddy-help.jpg" style="">
</div>
???
But they're stuck on your computer, and you need to share them easily others with out filling up their inboxes.
--
<div class="column" style="margin: 0 1em;">
<h3> Your new classroom </h3>
<img src="images/internet.jpg" style="">
</div>
</div>
???
And--- you probably have a new classroom space that looks like this-- so sharing needs to be done 100% online
---
class: center
background-image: url("images/rawpixel/lesson-time.jpg")
background-size: contain
background-color: #f6f6f6
## You might feel like this right now.
???
And you might feel like this right now.
Everything seems to need your attention,
but you cannot do everything.
---
class: middle, center
# Sharing on **short notice**
???
With that in mind, today we'll give you a quick tour of the...
---
class: middle, center
background-image: url("images/short1.jpg")
background-size: cover
# Sharing on **short notice**
???
**R Markdown tools** you can use to get your course materials...
---
class: middle, center
background-image: url("images/short2.jpg")
background-size: cover
# Sharing on **short notice**
???
**online**...
---
class: middle, center
background-image: url("images/short3.jpg")
background-size: cover
# Sharing on **short notice**
???
on **short notice**.
---
class: middle, center
background-image: url("images/rawpixel/inflation.jpg")
background-size: contain
background-color: #EBEAE6
???
So we'll show you how to build a course website to help you teach and reach learners using R Markdown, and friends.
Our goal is to give you a quick boost to help you get your site UP off the ground...
---
class: inverse, center
background-image: url("images/rawpixel/blue-balloon.jpg")
background-size: cover
# This
???
with a shareable link so that you can get on with your teaching...
---
class: top center
background-image: url("images/rawpixel/balloon-ouch.jpg")
background-position: bottom center
background-size: 40%
# Not this
???
and hopefully avoid crashing in the process.
---
class: center, top
## Why make a course website?
<img src="images/rawpixel/fortress.jpg" width="444" />
???
Why make a course website at all?
I think of it as a way first to help me organize my own stuff --
to get all my piles of teaching documents into some kind of order.
That makes it more **reproducible** -- for myself and others.
But it is also a way to make me more resilient --
if I'm organized AND online I can be more nimble when changes need to happen.
The side benefit of all this is that it is ALSO more **shareable**, so it makes it easier for learners too b/c they see what I see.
Because we'll be building websites with R Markdown, we'll start by talking about a single file. Desiree - you're up!
---
template: clouds
# What does an .Rmd look like?
???
Jumping right in, what *does* an R Markdown file look like?
---
class: center, middle
<img src="images/screenshots/Rproj1.png" width="544" />
???
Here is an r project folder for a lab.
---
class: center middle
<img src="images/screenshots/Rproj2.png" width="544" />
???
Inside that folder, you'll notice an RProj file. Opening that file in RStudio takes us...
---
background-image: url(images/screenshots/Single-rmd.png)
background-size: contain
class: middle, center
???
**here**, where we can see our single R Markdown file. This one is for a lab for visualizing data from the Museum of Modern Art.
Let's quickly walk through some of the key parts of this file.
---
background-image: url(images/screenshots/Single-rmd0.png)
background-size: contain
class: middle, center
???
It starts with metadata, written in YAML, which is a list of keys on the left and their values on the right.
---
class: middle, center
background-image: url(images/screenshots/Single-rmd1.png)
background-size: contain
???
The first key you see is the TITLE, which is `Lab 02: MoMA Museum Tour`.
---
class: middle, center
background-image: url(images/screenshots/Single-rmd2.png)
background-size: contain
???
The last YAML section is all about output. Here the output is an html document.
---
class: middle, center
background-image: url(images/screenshots/Single-rmd3.png)
background-size: contain
???
Beneath that, we can add options to our html document -- for example, a table of contents, with the key TOC set to TRUE.
---
class: middle, center
background-image: url(images/screenshots/Single-rmd4.png)
background-size: contain
???
So that's the metadata, but the real meat in your R Markdown file
is text written in markdown...
---
class: middle, center
background-image: url(images/screenshots/Single-rmd5.png)
background-size: contain
???
and your code, written in R.
So these 3 things: metadata, text, and code make up an R Markdown document.
---
class: top center
<video width="1530" height="610" controls>
<source src="images/single-doc-knit.mp4" type="video/mp4"> </video>
???
ALISON says:
Of course, Desiree, the real magic happens, when you click on the Knit icon, and see your file turned into HTML.
So, here's what that looks like:
- We knit
- We can watch in this bottom pane as our R Markdown document gets processed.
- And voila! -- we see our rendered HTML file.
- We can choose to open this up in a real browser window.
- And then just test a few things out.
---
class: middle center
background-image: url(images/screenshots/Single-knit1.png)
background-size: contain
???
Here is what we knit.
--
<img src="images/screenshots/Single-knit2.png" style="
position: absolute;
width: 91%;
top: -53px;
right: 5px;
">
???
Using the `THEME:` key in our YAML, we changed our font and colors.
--
<img src="images/screenshots/Single-knit3.png" style="
position: absolute;
width: 97%;
top: -45px;
right: -51px;
">
???
And we have this nice table of contents floating off to the side...
--
<img src="images/screenshots/Single-knit4.png" style="
position: absolute;
width: 73%;
bottom: 10px;
right: 80px;
">
???
But this is still local and stuck on my computer.
A *link* would make it easier to share.
---
template: clouds
class: center, middle
# How do we start .emphasis[sharing]?
???
So how do we start sharing?
---
background-image: url("images/Server.jpg")
background-size: 80%
background-position: bottom
class: center, top
# How do we start .emphasis[sharing]?
???
We need a **web server**...
--
<img src="https://github.com/nolistic.png" style="
position: absolute;
width: 10%;
top: 140px;
right: 60px;
border-radius: 50%;
">
???
which is basically a big computer in the clouds
hat/tip to Heather Nolis for that analogy.
--
<img src="images/Netlify.png" style="
position: absolute;
width: 23%;
top: 218px;
right: 301px;
">
???
And for this webinar, we'll use servers provided by Netlify.
---
class: top center
# How do we start .emphasis[sharing]?
.pull-left[
## Go here:
#### [app.netlify.com/drop](https://app.netlify.com/drop)
]
.pull-right[
<img src= "https://summer-of-blogdown.netlify.com/assets/netlify-drop.png" style="width: 85%;">
]
???
We are going to drag and drop our project folder into Netlify and put our webpage online.
So, Alison-- let's do our first drag and drop!
---
class: center, middle
<video width="1200" height="625" controls>
<source src="images/single-doc-dnd.mp4" type="video/mp4">
</video>
???
ALISON says:
So, I open up my browser, and go to app.netlify.com/drop --
and drag n drop the folder in.
A few seconds later, Netlify has auto-generated a silly-name link and deployed our page -- this link is where our Lab02 page now lives, and you can share your page with whomever you choose --
BOTH: hooray!
---
class: center, middle
background-image: url(images/Clouds.jpg)
background-size: cover
# What just happened?
???
What just happened?
---
background-image: url(images/what-happened/single-doc/Slide1.jpeg)
class: middle center
background-size: contain
???
**We started with an R Markdown file named index**
We knit this to convert to an internet-ready HTML file
It looked great, but still only lived locally in our R Project folder
So then we dragged and dropped our folder
Netlify deployed our page
and generated a link! Woohoo!
---
background-image: url(images/what-happened/single-doc/Slide2.jpeg)
class: middle center
background-size: contain
???
We started with an R Markdown file named index
**We knit this to convert to an internet-ready HTML file**
It looked great, but still only lived locally in our R Project folder
So then we dragged and dropped our folder
Netlify deployed our page
and generated a link! Woohoo!
---
background-image: url(images/what-happened/single-doc/Slide3.jpeg)
class: middle center
background-size: contain
???
We started with an R Markdown file named index
We knit this to convert to an internet-ready HTML file
**It looked great, but still only lived locally in our R Project folder**
So then we dragged and dropped our folder
Netlify deployed our page
and generated a link! Woohoo!
---
background-image: url(images/what-happened/single-doc/Slide4.jpeg)
class: middle center
background-size: contain
???
We started with an R Markdown file named index
We knit this to convert to an internet-ready HTML file
It looked great, but still only lived locally in our R Project folder
**So then we dragged and dropped our folder**
Netlify deployed our page
and generated a link! Woohoo!
---
background-image: url(images/what-happened/single-doc/Slide5.jpeg)
class: middle center
background-size: contain
???
We started with an R Markdown file named index
We knit this to convert to an internet-ready HTML file
It looked great, but still only lived locally in our R Project folder
So then we dragged and dropped our folder
**Netlify deployed our page**
and generated a link! Woohoo!
---
background-image: url(images/what-happened/single-doc/Slide6.jpeg)
class: middle center
background-size: contain
???
We started with an R Markdown file named index
We knit this to convert to an internet-ready HTML file
It looked great, but still only lived locally in our R Project folder
So then we dragged and dropped our folder
Netlify deployed our page
**and generated a link! Woohoo!**
---
background-image: url(images/rawpixel/single-balloon.jpg)
background-size: contain
background-position: left
class: middle, center
.pull-right[
### But that is just one .Rmd file...
]
???
But that is just one R Markdown file...
---
background-image: url(images/rawpixel/bunch-balloons.jpg)
background-size: contain
background-position: right
class: middle, center
.pull-left[
### We want to share many .Rmd files!
]
???
We want to share many R Markdown files!
---
background-image: url(images/mtsalsa0.jpg)
background-position: bottom center
background-size: contain
class: top, center
## So where are we going?
???
So we're going to hike Markdown mountain today...
---
background-image: url(images/mtsalsa.jpg)
background-position: bottom center
background-size: contain
class: top, center
## So where are we going?
???
And our goal for the rest of this webinar is to show you 4 R Markdown tools that are for turning a *COLLECTION* of RMDs into a web*site*.
---
name: default_site
class: top, center
background-image: url(images/mtsalsa-rmd.jpg)
background-size: contain
background-position: center, bottom
# `install.packages("rmarkdown")`
???
So let's begin with an R Markdown site.
To make one, you only need the `rmarkdown` package installed, which is already done for you if you use RStudio.
---
template: clouds2
class: center, top
<https://apreshill.github.io/data-vis-labs-2018>
<img src= "images/screenshots/RMD-site-wild.png" style="margin-top: -20px;">
???
Here is an R Markdown site for a course about data visualization. Actually, the MoMA lab we just turned into a webpage was one of the labs from this course.
Now this course website is a place to share **all** of the labs.
The biggest addition here is this top navigation bar...
--
<img src="images/Circle-nav.png" style="
position: absolute;
width: 16%;
top: 126px;
left: 253px;
">
???
which allows us to link to other webpages...
---
template: clouds2
class: center middle
<https://apreshill.github.io/data-vis-labs-2018>
<img src= "images/screenshots/RMD-site-wild.png" style="width: 110%; margin-top: -20px; visibility: hidden;">
<img src= "images/screenshots/RMD-site-wild1.png"
style="
position: absolute;
width: 103%;
top: 2px;
left: -1px;
">
???
including ones made with R Markdown, like this page with slides and readings...
---
template: clouds2
class: center middle
<https://apreshill.github.io/data-vis-labs-2018>
<img src= "images/screenshots/RMD-site-wild.png" style="width: 110%; margin-top: -20px; visibility: hidden;">
<img src= "images/screenshots/RMD-site-wild2.png"
style="
position: absolute;
width: 103%;
top: 2px;
left: -1px;
">
???
Or other websites, like this one here which goes to a learning management system.
---
name: build1
## Build your site
.pull-left[
```r
.
*├── rstats101.Rproj
├── _site.yml
├── index.Rmd
├── schedule.Rmd
├── lab01.Rmd
└── lab02.Rmd
```
]
.pull-right[
<img src="images/rproj.png" width="325" />
]
???
So let's build a minimal R Markdown site of our own.
Imagine that this box on the left is the list of files that are inside of our R Project folder.
---
name: build5
## Build your site
.left-column[
```r
.
├── rstats101.Rproj
├── _site.yml
├── index.Rmd
├── schedule.Rmd
├── lab01.Rmd
└── lab02.Rmd
```
]
.right-column[
<img src="images/screenshots/build-site.png" style="margin-top: -28px;">
]
???
To knit all these pages in our R Markdown site, you can mouse over to the Build Tab in RStudio and then click "Build Website".
---
name: build6
## Build your site
.left-column[
```r
.
├── rstats101.Rproj
*├── _site/
├── _site.yml
├── index.Rmd
├── schedule.Rmd
├── lab01.Rmd
└── lab02.Rmd
```
]
.right-column[
<img src="images/screenshots/build-site.png" style="margin-top: -28px;">
]
???
Now you can see that it created a new folder called `_site`- that is where our html files live.
---
template: clouds2
class: center top
![](images/screenshots/RMD-site.png)
???