generated from laser-institute/laser-getting-started
-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathorientation-case-study-key-R.html
2540 lines (2502 loc) · 147 KB
/
orientation-case-study-key-R.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 xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
<meta charset="utf-8">
<meta name="generator" content="quarto-1.4.550">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<meta name="author" content="LASER Institute">
<meta name="dcterms.date" content="2024-07-14">
<title>A Coding Case Study with Quarto</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
div.columns{display: flex; gap: min(4vw, 1.5em);}
div.column{flex: auto; overflow-x: auto;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
ul.task-list li input[type="checkbox"] {
width: 0.8em;
margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
vertical-align: middle;
}
/* CSS for syntax highlighting */
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
}
pre.numberSource { margin-left: 3em; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
/* CSS for citations */
div.csl-bib-body { }
div.csl-entry {
clear: both;
margin-bottom: 0em;
}
.hanging-indent div.csl-entry {
margin-left:2em;
text-indent:-2em;
}
div.csl-left-margin {
min-width:2em;
float:left;
}
div.csl-right-inline {
margin-left:2em;
padding-left:1em;
}
div.csl-indent {
margin-left: 2em;
}</style>
<script src="orientation-case-study-key-R_files/libs/clipboard/clipboard.min.js"></script>
<script src="orientation-case-study-key-R_files/libs/quarto-html/quarto.js"></script>
<script src="orientation-case-study-key-R_files/libs/quarto-html/popper.min.js"></script>
<script src="orientation-case-study-key-R_files/libs/quarto-html/tippy.umd.min.js"></script>
<script src="orientation-case-study-key-R_files/libs/quarto-html/anchor.min.js"></script>
<link href="orientation-case-study-key-R_files/libs/quarto-html/tippy.css" rel="stylesheet">
<link href="orientation-case-study-key-R_files/libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" class="quarto-color-scheme" id="quarto-text-highlighting-styles">
<link href="orientation-case-study-key-R_files/libs/quarto-html/quarto-syntax-highlighting-dark.css" rel="prefetch" class="quarto-color-scheme quarto-color-alternate" id="quarto-text-highlighting-styles">
<script src="orientation-case-study-key-R_files/libs/bootstrap/bootstrap.min.js"></script>
<link href="orientation-case-study-key-R_files/libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
<link href="orientation-case-study-key-R_files/libs/bootstrap/bootstrap.min.css" rel="stylesheet" class="quarto-color-scheme" id="quarto-bootstrap" data-mode="light">
<link href="orientation-case-study-key-R_files/libs/bootstrap/bootstrap-dark.min.css" rel="prefetch" class="quarto-color-scheme quarto-color-alternate" id="quarto-bootstrap" data-mode="dark">
</head>
<body>
<div id="quarto-content" class="page-columns page-rows-contents page-layout-article">
<div id="quarto-margin-sidebar" class="sidebar margin-sidebar">
<nav id="TOC" role="doc-toc" class="toc-active">
<h2 id="toc-title">Table of contents</h2>
<ul>
<li><a href="#introduction" id="toc-introduction" class="nav-link active" data-scroll-target="#introduction">0. INTRODUCTION</a>
<ul>
<li><a href="#how-to-use-this-quarto-document" id="toc-how-to-use-this-quarto-document" class="nav-link" data-scroll-target="#how-to-use-this-quarto-document">How to use this Quarto document</a>
<ul class="collapse">
<li><a href="#source-vs.-visual-editor" id="toc-source-vs.-visual-editor" class="nav-link" data-scroll-target="#source-vs.-visual-editor">Source vs. Visual Editor</a></li>
<li><a href="#your-turn" id="toc-your-turn" class="nav-link" data-scroll-target="#your-turn">👉 Your Turn ⤵</a></li>
<li><a href="#code-chunks" id="toc-code-chunks" class="nav-link" data-scroll-target="#code-chunks">Code Chunks</a></li>
<li><a href="#your-turn-1" id="toc-your-turn-1" class="nav-link" data-scroll-target="#your-turn-1">👉 Your Turn ⤵</a></li>
<li><a href="#question" id="toc-question" class="nav-link" data-scroll-target="#question">❓Question</a></li>
</ul></li>
<li><a href="#the-data-intensive-research-workflow" id="toc-the-data-intensive-research-workflow" class="nav-link" data-scroll-target="#the-data-intensive-research-workflow">The Data-Intensive Research Workflow</a></li>
</ul></li>
<li><a href="#prepare" id="toc-prepare" class="nav-link" data-scroll-target="#prepare">1. PREPARE</a>
<ul>
<li><a href="#research-question" id="toc-research-question" class="nav-link" data-scroll-target="#research-question">Research Question</a></li>
<li><a href="#projects-packages" id="toc-projects-packages" class="nav-link" data-scroll-target="#projects-packages">Projects & Packages 📦</a>
<ul class="collapse">
<li><a href="#your-turn-2" id="toc-your-turn-2" class="nav-link" data-scroll-target="#your-turn-2">👉 Your Turn ⤵</a></li>
<li><a href="#tidyverse" id="toc-tidyverse" class="nav-link" data-scroll-target="#tidyverse">tidyverse 📦</a></li>
<li><a href="#your-turn-3" id="toc-your-turn-3" class="nav-link" data-scroll-target="#your-turn-3">👉 Your Turn ⤵</a></li>
<li><a href="#skimr" id="toc-skimr" class="nav-link" data-scroll-target="#skimr">skimr 📦</a></li>
<li><a href="#your-turn-4" id="toc-your-turn-4" class="nav-link" data-scroll-target="#your-turn-4">👉 Your Turn ⤵</a></li>
</ul></li>
<li><a href="#loading-or-reading-in-data" id="toc-loading-or-reading-in-data" class="nav-link" data-scroll-target="#loading-or-reading-in-data">Loading (or reading in) data</a>
<ul class="collapse">
<li><a href="#your-turn-5" id="toc-your-turn-5" class="nav-link" data-scroll-target="#your-turn-5">👉 Your Turn ⤵</a></li>
<li><a href="#viewing-and-inspecting-data" id="toc-viewing-and-inspecting-data" class="nav-link" data-scroll-target="#viewing-and-inspecting-data">Viewing and inspecting data</a></li>
<li><a href="#your-turn-6" id="toc-your-turn-6" class="nav-link" data-scroll-target="#your-turn-6">👉 Your Turn ⤵</a></li>
<li><a href="#question-1" id="toc-question-1" class="nav-link" data-scroll-target="#question-1">❓Question</a></li>
<li><a href="#question-2" id="toc-question-2" class="nav-link" data-scroll-target="#question-2">❓Question</a></li>
</ul></li>
</ul></li>
<li><a href="#wrangle" id="toc-wrangle" class="nav-link" data-scroll-target="#wrangle">2. WRANGLE</a>
<ul>
<li><a href="#selecting-variables" id="toc-selecting-variables" class="nav-link" data-scroll-target="#selecting-variables">Selecting variables</a>
<ul class="collapse">
<li><a href="#your-turn-7" id="toc-your-turn-7" class="nav-link" data-scroll-target="#your-turn-7">👉 Your Turn ⤵</a></li>
<li><a href="#your-turn-8" id="toc-your-turn-8" class="nav-link" data-scroll-target="#your-turn-8">👉 Your Turn ⤵</a></li>
</ul></li>
<li><a href="#filtering-variables" id="toc-filtering-variables" class="nav-link" data-scroll-target="#filtering-variables">Filtering variables</a>
<ul class="collapse">
<li><a href="#your-turn-9" id="toc-your-turn-9" class="nav-link" data-scroll-target="#your-turn-9">👉 Your Turn ⤵</a></li>
<li><a href="#question-3" id="toc-question-3" class="nav-link" data-scroll-target="#question-3">❓Question</a></li>
</ul></li>
<li><a href="#arrange" id="toc-arrange" class="nav-link" data-scroll-target="#arrange">Arrange</a>
<ul class="collapse">
<li><a href="#your-turn-10" id="toc-your-turn-10" class="nav-link" data-scroll-target="#your-turn-10">👉 Your Turn ⤵</a></li>
</ul></li>
</ul></li>
<li><a href="#explore" id="toc-explore" class="nav-link" data-scroll-target="#explore">3. EXPLORE</a>
<ul>
<li><a href="#summary-statistics" id="toc-summary-statistics" class="nav-link" data-scroll-target="#summary-statistics">Summary Statistics</a>
<ul class="collapse">
<li><a href="#your-turn-11" id="toc-your-turn-11" class="nav-link" data-scroll-target="#your-turn-11">👉 Your Turn ⤵</a></li>
</ul></li>
<li><a href="#data-visualization" id="toc-data-visualization" class="nav-link" data-scroll-target="#data-visualization">Data Visualization</a></li>
<li><a href="#the-graphing-workflow" id="toc-the-graphing-workflow" class="nav-link" data-scroll-target="#the-graphing-workflow">The Graphing Workflow</a>
<ul class="collapse">
<li><a href="#your-turn-12" id="toc-your-turn-12" class="nav-link" data-scroll-target="#your-turn-12">👉 Your Turn ⤵</a></li>
<li><a href="#your-turn-13" id="toc-your-turn-13" class="nav-link" data-scroll-target="#your-turn-13">👉 Your Turn ⤵</a></li>
</ul></li>
<li><a href="#scatterplots" id="toc-scatterplots" class="nav-link" data-scroll-target="#scatterplots">Scatterplots</a>
<ul class="collapse">
<li><a href="#your-turn-14" id="toc-your-turn-14" class="nav-link" data-scroll-target="#your-turn-14">👉 Your Turn ⤵</a></li>
</ul></li>
</ul></li>
<li><a href="#model" id="toc-model" class="nav-link" data-scroll-target="#model">4. MODEL</a>
<ul>
<li><a href="#an-inferential-model" id="toc-an-inferential-model" class="nav-link" data-scroll-target="#an-inferential-model">An Inferential Model</a>
<ul class="collapse">
<li><a href="#your-turn-15" id="toc-your-turn-15" class="nav-link" data-scroll-target="#your-turn-15">👉 Your Turn ⤵</a></li>
<li><a href="#your-turn-16" id="toc-your-turn-16" class="nav-link" data-scroll-target="#your-turn-16">👉 Your Turn ⤵</a></li>
<li><a href="#question-4" id="toc-question-4" class="nav-link" data-scroll-target="#question-4">❓Question</a></li>
</ul></li>
<li><a href="#a-predictive-model" id="toc-a-predictive-model" class="nav-link" data-scroll-target="#a-predictive-model">A Predictive Model</a>
<ul class="collapse">
<li><a href="#your-turn-17" id="toc-your-turn-17" class="nav-link" data-scroll-target="#your-turn-17"><strong>👉 Your Turn</strong> <strong>⤵</strong></a></li>
<li><a href="#your-turn-18" id="toc-your-turn-18" class="nav-link" data-scroll-target="#your-turn-18"><strong>👉 Your Turn</strong> <strong>⤵</strong></a></li>
<li><a href="#question-5" id="toc-question-5" class="nav-link" data-scroll-target="#question-5">❓Question</a></li>
</ul></li>
</ul></li>
<li><a href="#communicate" id="toc-communicate" class="nav-link" data-scroll-target="#communicate">5. COMMUNICATE</a>
<ul>
<li><a href="#render-document" id="toc-render-document" class="nav-link" data-scroll-target="#render-document">Render Document</a>
<ul class="collapse">
<li><a href="#your-turn-19" id="toc-your-turn-19" class="nav-link" data-scroll-target="#your-turn-19">👉 Your Turn ⤵</a></li>
</ul></li>
<li><a href="#publish-file" id="toc-publish-file" class="nav-link" data-scroll-target="#publish-file">Publish File</a>
<ul class="collapse">
<li><a href="#your-turn-20" id="toc-your-turn-20" class="nav-link" data-scroll-target="#your-turn-20">👉 Your Turn ⤵</a></li>
<li><a href="#publishing-with-quarto-pub" id="toc-publishing-with-quarto-pub" class="nav-link" data-scroll-target="#publishing-with-quarto-pub">Publishing with Quarto Pub</a></li>
<li><a href="#publishing-with-r-pubs" id="toc-publishing-with-r-pubs" class="nav-link" data-scroll-target="#publishing-with-r-pubs">Publishing with R Pubs</a></li>
</ul></li>
<li><a href="#your-first-laser-badge" id="toc-your-first-laser-badge" class="nav-link" data-scroll-target="#your-first-laser-badge">Your First LASER Badge!</a></li>
<li><a href="#references" id="toc-references" class="nav-link" data-scroll-target="#references">References</a></li>
</ul></li>
</ul>
</nav>
</div>
<main class="content" id="quarto-document-content">
<header id="title-block-header" class="quarto-title-block default">
<div class="quarto-title">
<h1 class="title">A Coding Case Study with Quarto</h1>
<p class="subtitle lead">LASER Orientation Module</p>
</div>
<div class="quarto-title-meta">
<div>
<div class="quarto-title-meta-heading">Author</div>
<div class="quarto-title-meta-contents">
<p>LASER Institute </p>
</div>
</div>
<div>
<div class="quarto-title-meta-heading">Published</div>
<div class="quarto-title-meta-contents">
<p class="date">July 14, 2024</p>
</div>
</div>
</div>
</header>
<section id="introduction" class="level2">
<h2 class="anchored" data-anchor-id="introduction">0. INTRODUCTION</h2>
<p><img src="img/LASER_Hx.png" class="img-fluid" style="width:40.0%"></p>
<p>Welcome to your first LASER Case Study! The case study activities included in each module demonstrate how key Learning Analytics (LA) techniques featured in exemplary STEM education research studies can be implemented with R or Python. Case studies also provide a holistic setting to explore important foundational topics integral to Learning Analytics such as reproducible research, use of APIs, and ethical use of educational data.</p>
<p>This orientation case study will also introduce you to <a href="https://quarto.org">Quarto</a>, which is heavily integrated into each LASER Module. You may have used Quarto before - or you may not have! Either is fine as this task will be designed with the assumption that you have not used Quarto before.</p>
<section id="how-to-use-this-quarto-document" class="level3">
<h3 class="anchored" data-anchor-id="how-to-use-this-quarto-document">How to use this Quarto document</h3>
<p>What you are working in now is an <strong>Q</strong>uarto <strong>m</strong>ark<strong>d</strong>own file as indicated by the .<strong>qmd</strong> file name extension. Quarto documents are fully reproducible and use a productive notebook interface to combine formatted text and “chunks” of code to produce a range of <a href="https://quarto.org/docs/guide/">static and dynamic output formats</a> including: HTML, PDF, Word, HTML5 slides, Tufte-style handouts, books, dashboards, shiny applications, scientific articles, websites, and more.</p>
<div class="callout callout-style-default callout-tip callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Tip
</div>
</div>
<div class="callout-body-container callout-body">
<p>Quarto docs can include specially formatted <strong>callout boxes</strong> like this one to draw special attention to provide notes, tips, cautions, warnings, and important information.</p>
<p><strong>Pro tip</strong>: Quarto documents also have a handy Outline feature that allow you to easily navigate the entire document. If the outline is not currently visible, click the Outline button located on the right of the toolbar at the top of this document.</p>
</div>
</div>
<section id="source-vs.-visual-editor" class="level4">
<h4 class="anchored" data-anchor-id="source-vs.-visual-editor">Source vs. Visual Editor</h4>
<p>Following best practices for reproducible research <span class="citation" data-cites="gandrud2021">(<a href="#ref-gandrud2021" role="doc-biblioref">Gandrud 2021</a>)</span>, Quarto files store information in plain text <a href="https://bookdown.org/yihui/rmarkdown/markdown-syntax.html">markdown</a> syntax. You are currently viewing this Quarto document using the visual editor, The visual editor is set as the default view in the <a href="https://quarto.org/docs/get-started/hello/rstudio.html#yaml-header">Quarto YAML header</a> at the top of this document. Basically, a <a href="https://monashdatafluency.github.io/r-rep-res/yaml-header.html#">YAML header</a> is:</p>
<blockquote class="blockquote">
<p>a short blob of text that… not only dictates the final file format, but a style and feel for our final document.</p>
</blockquote>
<p>The visual editor allows you to view formatted headers, text and code chunks and is a bit more “human readable” than markdown syntax but there will be many occasions where you will want to take a look at the plain text source code underlying this document. This can be viewed at any point by switching to source mode for editing. You can toggle back and forth between these two modes by clicking on <strong>Source</strong> and <strong>Visual</strong> in the editor toolbar.</p>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Note
</div>
</div>
<div class="callout-body-container callout-body">
<p>You may have noticed a special kind of link in the text above. Specifically, a link citing Reproducible Research with R and R Studio by Chris Gandrud. The YAML header includes a bibliography option and points to our <code>reference.bib</code> file in the <code>lit</code> folder of this project, which produces a nice tooltip for linked references and a bibliography when our doc is <a href="https://quarto.org/docs/get-started/hello/rstudio.html#rendering">rendered</a> and <a href="https://quarto.org/docs/get-started/authoring/rstudio.html#publishing">published</a>. Click the following link to learn more about <a href="https://quarto.org/docs/authoring/citations.html">citations in Quarto</a>.</p>
</div>
</div>
</section>
<section id="your-turn" class="level4">
<h4 class="anchored" data-anchor-id="your-turn">👉 Your Turn ⤵</h4>
<p>LASER case studies include many interactive elements in which you are asked to perform an action, answer some questions, or write some code. These are indicated by the <strong>👉 Your Turn</strong> <strong>⤵</strong> header. Now it’s your turn to do something.</p>
<p>Take a look at the markdown syntax used to create this document by viewing with the source editor. To do so, click the “Source” button in the toolbar at the top of this file. After you’ve had a look, click back to the visual editor to continue.</p>
<p><img src="img/source-view.png" class="img-fluid" style="width:100.0%"></p>
<p>Great job! Let’s continue!</p>
</section>
<section id="code-chunks" class="level4">
<h4 class="anchored" data-anchor-id="code-chunks">Code Chunks</h4>
<p>In addition to including formatted text hyperlinks, and embedded images like above, Quarto documents can also include a specially formatted text box called a “<a href="https://quarto.org/docs/get-started/hello/rstudio.html#code-chunks">code chunk</a>.” These chunks allows you to run code from multiple languages including R, Python, and SQL. For example, the code chunk below is intended to run R code as specified by “r” inside the curly brackets <code>{}</code>. It also contains a contains a code “comment” as indicted by the # hashtag and line of R code. You may have also noticed a set of buttons in the upper right corner of the code chunk which are used to execute the code.</p>
</section>
<section id="your-turn-1" class="level4">
<h4 class="anchored" data-anchor-id="your-turn-1">👉 Your Turn ⤵</h4>
<p>Click the green arrow <img src="https://d33wubrfki0l68.cloudfront.net/18153fb9953057ee5cff086122bd26f9cee8fe93/3aba9/images/notebook-run-chunk.png" class="img-fluid">icon on the right side of the code chunk to run the R code and view the image file name <code>laser-cycle.png</code> stored in the <code>img</code> folder in your files pane. Quarto will execute the code and its output and any related messages are displayed below the chunk.</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Display an image from the specified path using the knitr package in R</span></span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a>knitr<span class="sc">::</span><span class="fu">include_graphics</span>(<span class="st">"img/laser-cycle.png"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="img/laser-cycle.png" class="img-fluid figure-img" width="743"></p>
</figure>
</div>
</div>
</div>
<p>Nice work! For this case study, don’t stress too much about understanding the code. We’ll spend a lot of time doing that in the other modules. For now, take a look at the image displayed and answer the question that follows by typing your response directly in this document.</p>
</section>
<section id="question" class="level4">
<h4 class="anchored" data-anchor-id="question">❓Question</h4>
<p>In LASER case studies, you will often see as part of “Your Turns” a ❓ icon that indicates you are being promoted to answer a question. Type your response to the following question by deleting “YOUR RESPONSE HERE” and adding your own response:</p>
<p>What do you think this image is intended to illustrate?</p>
<ul>
<li>YOUR RESPONSE HERE</li>
</ul>
</section>
</section>
<section id="the-data-intensive-research-workflow" class="level3">
<h3 class="anchored" data-anchor-id="the-data-intensive-research-workflow">The Data-Intensive Research Workflow</h3>
<p>The diagram shown above illustrates a Learning Analytics framework called the Data-Intensive Research workflow and comes from the excellent book, Learning Analytics Goes to School <span class="citation" data-cites="krumm2018">(<a href="#ref-krumm2018" role="doc-biblioref">Krumm, Means, and Bienkowski 2018</a>)</span><em>.</em> You can check that out later, but don’t feel any need to dive deep into it for now - we spend more time unpacking this framework in our <a href="https://laser-institute.github.io/laser-website/curriculum-la-workflow.html">Learning Analytics Workflow Modules</a>; just know that this case study and all of the case studies in our <a href="https://laser-institute.github.io/laser-website/curriculum-design.html#modules-topics">LASER curriculum modules</a> are organized around the five main components of this workflow.</p>
<p>In this introductory coding case study, we’ll focus on the following tasks specific to each component of the workflow:</p>
<ol type="1">
<li><strong>Prepare</strong>. Understand the research context, software packages, and data collected.</li>
<li><strong>Wrangle</strong>. Select and filter variables and “wrangle” them in a tabular (think spreadsheet!) format.</li>
<li><strong>Explore</strong>. Create some basic summary tables and plots to understand our data better.</li>
<li><strong>Model</strong>. Run a basic model - specifically, a simple regression model.</li>
<li><strong>Communicate</strong>. Create a reproducible report of your work that you can share with others.</li>
</ol>
<p>Now, let’s get started!</p>
</section>
</section>
<section id="prepare" class="level2">
<h2 class="anchored" data-anchor-id="prepare">1. PREPARE</h2>
<p>First and foremost, data-intensive research involves defining and refining a research question and developing an understanding of where your data comes from <span class="citation" data-cites="krumm2018">(<a href="#ref-krumm2018" role="doc-biblioref">Krumm, Means, and Bienkowski 2018</a>)</span>. This part of the process also involves setting up a reproducible research environment so your work can be understood and replicated by other researchers <span class="citation" data-cites="gandrud2021">(<a href="#ref-gandrud2021" role="doc-biblioref">Gandrud 2021</a>)</span>. For now, we’ll focus on just a few parts of this process, diving in much more deeply into these components in later learning modules.</p>
<section id="research-question" class="level3">
<h3 class="anchored" data-anchor-id="research-question">Research Question</h3>
<p>In this case study, we’ll be working with data come from an unpublished research study by LASER team member, <a href="https://joshuamrosenberg.com">Josh Rosenberg</a>, which utilized a number of different data sources to understand high school students’ motivation within the context of online courses.</p>
<p>These data sets and related research questions are explored in much greater detail in other modules, but for the purpose of this case study, our analysis will be driven by the following research question:</p>
<p><em>Is there a relationship between the time students spend on a course (as measured through their learning management system) and their final course grade?</em></p>
</section>
<section id="projects-packages" class="level3">
<h3 class="anchored" data-anchor-id="projects-packages">Projects & Packages 📦</h3>
<p>As highlighted in <a href="https://datascienceineducation.com/c06.html">Chapter 6 of Data Science in Education Using R</a> <span class="citation" data-cites="estrellado2020e">(<a href="#ref-estrellado2020e" role="doc-biblioref">Estrellado et al. 2020</a>)</span>, one of the first steps of every research workflow should be to set up a “Project” within RStudio.</p>
<blockquote class="blockquote">
<p>A <strong>Project</strong> is the home for all of the files, images, reports, and code that are used in any given project.</p>
</blockquote>
<p>We are working in Posit Cloud with an R project <a href="https://github.com/laser-institute/laser-orientation">cloned from GitHub</a>, so a project has already been set up for you as indicated by the <code>.Rproj</code> file in the main directory.</p>
<section id="your-turn-2" class="level4">
<h4 class="anchored" data-anchor-id="your-turn-2">👉 Your Turn ⤵</h4>
<p>Locate the Files tab lower right hand window pane and see if you can find the file named <code>laser-orientation.Rproj</code>.</p>
<p>Since a project already set up for us, we will instead focus on loading the required packages we’ll need for analysis.</p>
<blockquote class="blockquote">
<p><strong>Packages</strong>, sometimes referred to as libraries, are shareable collections of R code that can contain functions, data, and/or documentation and extend the functionality of R.</p>
</blockquote>
<p>You can always check to see which packages have already been installed and loaded into RStudio by looking at the Packages tab in the same pane as the Files tab. Click the packages tab to see which packages have already been installed for this project.</p>
</section>
<section id="tidyverse" class="level4">
<h4 class="anchored" data-anchor-id="tidyverse">tidyverse 📦</h4>
<p><img src="img/tidyverse.png" class="img-fluid" style="width:30.0%"></p>
<p>One package that we’ll be using extensively in our learning modules is the {tidyverse} package. The {tidyverse} is actually a <a href="https://www.tidyverse.org/packages">collection of R packages</a> designed for wrangling and exploring data (sound familiar?) and which all share an underlying design philosophy, grammar, and data structures. These shared features are sometimes referred to as “<a href="https://r4ds.had.co.nz/tidy-data.html">tidy data principles</a>” <span class="citation" data-cites="wickham2016r">(<a href="#ref-wickham2016r" role="doc-biblioref">Wickham and Grolemund 2016</a>)</span>.</p>
</section>
<section id="your-turn-3" class="level4">
<h4 class="anchored" data-anchor-id="your-turn-3">👉 Your Turn ⤵</h4>
<p>To load the tidyverse, we’ll use the <code>library()</code> function. Go ahead and run the code chunk below:</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(tidyverse)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stderr">
<pre><code>── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.5
✔ forcats 1.0.0 ✔ stringr 1.5.1
✔ ggplot2 3.5.1 ✔ tibble 3.2.1
✔ lubridate 1.9.3 ✔ tidyr 1.3.1
✔ purrr 1.0.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors</code></pre>
</div>
</div>
<div class="callout callout-style-default callout-caution callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Caution
</div>
</div>
<div class="callout-body-container callout-body">
<p>Please do not worry if you saw a number of messages. Those probably mean that the <code>tidyverse</code> loaded just fine. If you see an “error” message, however, try to interpret or search via your search engine the contents of the error, or reach out to us for assistance.</p>
</div>
</div>
</section>
<section id="skimr" class="level4">
<h4 class="anchored" data-anchor-id="skimr">skimr 📦</h4>
<p><img src="img/skimr.png" class="img-fluid" style="width:20.0%"></p>
<p>The {<a href="https://github.com/ropensci/skimr">skimr</a>} package is a handy package that provides summary statistics that you can skim quickly to understand your data and see what may be missing. We’ll be using this later in the Explore section of this case study.</p>
</section>
<section id="your-turn-4" class="level4">
<h4 class="anchored" data-anchor-id="your-turn-4">👉 Your Turn ⤵</h4>
<p>As we noted in the beginning, these case studies are meant to be interactive. Throughout each case study, we will ask to you apply some of your R skills to help with the analysis. This intended to help you practice newly introduced functions or R code and reinforce R skills you have already learned.</p>
<p>Now use the <code>library()</code> function in the code chunk below to load the <code>skimr</code> package into our environment as well.</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb4"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(skimr)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
</section>
<section id="loading-or-reading-in-data" class="level3">
<h3 class="anchored" data-anchor-id="loading-or-reading-in-data">Loading (or reading in) data</h3>
<p>The data we’ll explore in this case study were originally collected for a research study, which utilized a number of different data sources to understand students’ course-related motivation. These courses were designed and taught by instructors through a statewide online course provider designed to supplement – but not replace – students’ enrollment in their local school.</p>
<p>The data used in this case study has already been “wrangled” quite a bit, but the original datasets included:</p>
<ol type="1">
<li><p>A self-report survey assessing three aspects of students’ motivation</p></li>
<li><p>Log-trace data, such as data output from the learning management system (LMS)</p></li>
<li><p>Discussion board data</p></li>
<li><p>Academic achievement data</p></li>
</ol>
<p>If you are interested in learning more about these datasets, you can visit Chapter 7 of the excellent book, <a href="https://datascienceineducation.com/c07.html#data-sources"><em>Data Science in Education Using R</em></a><span class="citation" data-cites="estrellado2020e">(<a href="#ref-estrellado2020e" role="doc-biblioref">Estrellado et al. 2020</a>)</span>.</p>
<section id="your-turn-5" class="level4">
<h4 class="anchored" data-anchor-id="your-turn-5">👉 Your Turn ⤵</h4>
<p>Next, we’ll load our data - specifically, a CSV text file, the kind that you can export from Microsoft Excel or Google Sheets - into R, using the <code>read_csv()</code> function in the next chunk.</p>
<p>Clicking the green arrow runs the code; do that next to read the <code>sci-online-classes.csv</code> file stored in the <code>data</code> folder of your R project:</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb5"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>sci_data <span class="ot"><-</span> <span class="fu">read_csv</span>(<span class="st">"data/sci-online-classes.csv"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stderr">
<pre><code>Rows: 603 Columns: 30
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (6): course_id, subject, semester, section, Gradebook_Item, Gender
dbl (23): student_id, total_points_possible, total_points_earned, percentage...
lgl (1): Grade_Category
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.</code></pre>
</div>
</div>
<p>Nice work! You should now see a new data “object” named <code>sci_data</code> saved in your Environment pane. Try clicking on it and see what happens!</p>
<div class="callout callout-style-default callout-important callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Important
</div>
</div>
<div class="callout-body-container callout-body">
<p>It’s important to note that by manipulating data with the {tidyverse} package, we are <strong>not</strong> changing the original file. Instead, the data is stored in memory and can be viewed in our <strong>Environment</strong> pane, and can later be exported and saved as a new file is desired.</p>
</div>
</div>
</section>
<section id="viewing-and-inspecting-data" class="level4">
<h4 class="anchored" data-anchor-id="viewing-and-inspecting-data">Viewing and inspecting data</h4>
<p>Now let’s learn another way to inspect our data.</p>
</section>
<section id="your-turn-6" class="level4">
<h4 class="anchored" data-anchor-id="your-turn-6">👉 Your Turn ⤵</h4>
<p>Run the next chunk and look at the results, tabbing left or right with the arrows, or scanning through the rows by clicking the numbers at the bottom of the pane with the print-out of the data frame you “assigned” to the <code>sci_data</code> object in the previous code-chunk:</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb7"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a>sci_data</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code># A tibble: 603 × 30
student_id course_id total_points_possible total_points_earned
<dbl> <chr> <dbl> <dbl>
1 43146 FrScA-S216-02 3280 2220
2 44638 OcnA-S116-01 3531 2672
3 47448 FrScA-S216-01 2870 1897
4 47979 OcnA-S216-01 4562 3090
5 48797 PhysA-S116-01 2207 1910
6 51943 FrScA-S216-03 4208 3596
7 52326 AnPhA-S216-01 4325 2255
8 52446 PhysA-S116-01 2086 1719
9 53447 FrScA-S116-01 4655 3149
10 53475 FrScA-S116-02 1710 1402
# ℹ 593 more rows
# ℹ 26 more variables: percentage_earned <dbl>, subject <chr>, semester <chr>,
# section <chr>, Gradebook_Item <chr>, Grade_Category <lgl>,
# FinalGradeCEMS <dbl>, Points_Possible <dbl>, Points_Earned <dbl>,
# Gender <chr>, q1 <dbl>, q2 <dbl>, q3 <dbl>, q4 <dbl>, q5 <dbl>, q6 <dbl>,
# q7 <dbl>, q8 <dbl>, q9 <dbl>, q10 <dbl>, TimeSpent <dbl>,
# TimeSpent_hours <dbl>, TimeSpent_std <dbl>, int <dbl>, pc <dbl>, uv <dbl></code></pre>
</div>
</div>
<div class="callout callout-style-default callout-tip callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Tip
</div>
</div>
<div class="callout-body-container callout-body">
<p>You can also enlarge this output by clicking the “Show in New Window” button located in the top right corner of the output.</p>
</div>
</div>
</section>
<section id="question-1" class="level4">
<h4 class="anchored" data-anchor-id="question-1">❓Question</h4>
<p>What do you notice about this data set? What do you wonder? Add one or two observations in the space below:</p>
<ul>
<li>YOUR RESPONSE HERE</li>
</ul>
<p>There are many other ways to inspect your data; the <code>glimpse()</code> function provides one such way. Complete the code chunk below to take a “glimpse” at your <code>sci_data</code>.</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb9"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="fu">glimpse</span>(sci_data)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>Rows: 603
Columns: 30
$ student_id <dbl> 43146, 44638, 47448, 47979, 48797, 51943, 52326,…
$ course_id <chr> "FrScA-S216-02", "OcnA-S116-01", "FrScA-S216-01"…
$ total_points_possible <dbl> 3280, 3531, 2870, 4562, 2207, 4208, 4325, 2086, …
$ total_points_earned <dbl> 2220, 2672, 1897, 3090, 1910, 3596, 2255, 1719, …
$ percentage_earned <dbl> 0.6768293, 0.7567261, 0.6609756, 0.6773345, 0.86…
$ subject <chr> "FrScA", "OcnA", "FrScA", "OcnA", "PhysA", "FrSc…
$ semester <chr> "S216", "S116", "S216", "S216", "S116", "S216", …
$ section <chr> "02", "01", "01", "01", "01", "03", "01", "01", …
$ Gradebook_Item <chr> "POINTS EARNED & TOTAL COURSE POINTS", "ATTEMPTE…
$ Grade_Category <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
$ FinalGradeCEMS <dbl> 93.45372, 81.70184, 88.48758, 81.85260, 84.00000…
$ Points_Possible <dbl> 5, 10, 10, 5, 438, 5, 10, 10, 443, 5, 12, 10, 5,…
$ Points_Earned <dbl> NA, 10.00, NA, 4.00, 399.00, NA, NA, 10.00, 425.…
$ Gender <chr> "M", "F", "M", "M", "F", "F", "M", "F", "F", "M"…
$ q1 <dbl> 5, 4, 5, 5, 4, NA, 5, 3, 4, NA, NA, 4, 3, 5, NA,…
$ q2 <dbl> 4, 4, 4, 5, 3, NA, 5, 3, 3, NA, NA, 5, 3, 3, NA,…
$ q3 <dbl> 4, 3, 4, 3, 3, NA, 3, 3, 3, NA, NA, 3, 3, 5, NA,…
$ q4 <dbl> 5, 4, 5, 5, 4, NA, 5, 3, 4, NA, NA, 5, 3, 5, NA,…
$ q5 <dbl> 5, 4, 5, 5, 4, NA, 5, 3, 4, NA, NA, 5, 4, 5, NA,…
$ q6 <dbl> 5, 4, 4, 5, 4, NA, 5, 4, 3, NA, NA, 5, 3, 5, NA,…
$ q7 <dbl> 5, 4, 4, 4, 4, NA, 4, 3, 3, NA, NA, 5, 3, 5, NA,…
$ q8 <dbl> 5, 5, 5, 5, 4, NA, 5, 3, 4, NA, NA, 4, 3, 5, NA,…
$ q9 <dbl> 4, 4, 3, 5, NA, NA, 5, 3, 2, NA, NA, 5, 2, 2, NA…
$ q10 <dbl> 5, 4, 5, 5, 3, NA, 5, 3, 5, NA, NA, 4, 4, 5, NA,…
$ TimeSpent <dbl> 1555.1667, 1382.7001, 860.4335, 1598.6166, 1481.…
$ TimeSpent_hours <dbl> 25.91944500, 23.04500167, 14.34055833, 26.643610…
$ TimeSpent_std <dbl> -0.18051496, -0.30780313, -0.69325954, -0.148446…
$ int <dbl> 5.0, 4.2, 5.0, 5.0, 3.8, 4.6, 5.0, 3.0, 4.2, NA,…
$ pc <dbl> 4.50, 3.50, 4.00, 3.50, 3.50, 4.00, 3.50, 3.00, …
$ uv <dbl> 4.333333, 4.000000, 3.666667, 5.000000, 3.500000…</code></pre>
</div>
</div>
</section>
<section id="question-2" class="level4">
<h4 class="anchored" data-anchor-id="question-2">❓Question</h4>
<p>We have a couple more questions to pose to you before wrangling the data we just imported.</p>
<p>Generally, rows typically represent “cases,” the units that we measure, or the units on which we collect data. This is not a trick question! What counts as a “case” (and therefore what is represented as a row) varies by (and within) fields. There may be multiple types or levels of units studied in your field; listing more than one is fine! Also, please consider what columns - which usually represent variables - represent in your area of work and/or research.</p>
<p>What do rows typically (or you think may) represent in your research:</p>
<ul>
<li>YOUR RESPONSE HERE</li>
</ul>
<p>What do columns typically (or you think may) represent in your research:</p>
<ul>
<li>YOUR RESPONSE HERE</li>
</ul>
<p>Next, we’ll use a few functions that are handy for preparing data in table form.</p>
</section>
</section>
</section>
<section id="wrangle" class="level2">
<h2 class="anchored" data-anchor-id="wrangle">2. WRANGLE</h2>
<p>By wrangle, we refer to the process of cleaning and processing data, and, in some cases, merging (or joining) data from multiple sources. Often, this part of the process is very (surprisingly) time-intensive! Wrangling your data into shape can itself be an important accomplishment! And documenting your code using R scripts or Quarto files will save yourself and others a great deal of time wrangling data in the future! There are great tools in R for data wrangling, especially through the use of the {<a href="https://dplyr.tidyverse.org">dplyr</a>} package which is part of the {tidyverse} suite of packages.</p>
<section id="selecting-variables" class="level3">
<h3 class="anchored" data-anchor-id="selecting-variables">Selecting variables</h3>
<p>Recall from our Prepare section that we are interested the relationship between the time students spend on a course and their final course grade.</p>
<p>Let’s practice selecting these variables by introducing a very powerful <code>|></code> operator called a <strong>pipe</strong>. Pipes are a powerful tool for combining a sequence of functions or processes.</p>
<section id="your-turn-7" class="level4">
<h4 class="anchored" data-anchor-id="your-turn-7">👉 Your Turn ⤵</h4>
<p>Run the following code chunk to “pipe” our <code>sci_data</code> to the <code>select()</code> function include the following two variables as arguments:</p>
<ul>
<li><p><code>FinalGradeCEMS</code> (i.e., students’ final grades on a 0-100 point scale)</p></li>
<li><p><code>TimeSpent</code> (i.e., the number of minutes they spent in the course’s learning management system)</p></li>
</ul>
<div class="cell">
<div class="sourceCode cell-code" id="cb11"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a>sci_data <span class="sc">|></span> </span>
<span id="cb11-2"><a href="#cb11-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">select</span>(FinalGradeCEMS, TimeSpent)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code># A tibble: 603 × 2
FinalGradeCEMS TimeSpent
<dbl> <dbl>
1 93.5 1555.
2 81.7 1383.
3 88.5 860.
4 81.9 1599.
5 84 1482.
6 NA 3.45
7 83.6 1322.
8 97.8 1390.
9 96.1 1479.
10 NA NA
# ℹ 593 more rows</code></pre>
</div>
</div>
<p>Notice how the number of columns (variables) is now different!</p>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Note
</div>
</div>
<div class="callout-body-container callout-body">
<p>It’s important to note that since we haven’t “assigned” this filtered data frame to a new object using the <code><-</code> assignment operator, the number of variables in the <code>sci_data</code> data frame in our environment is still 30, not 2.</p>
</div>
</div>
<p>Let’s <em>include one additional variable</em> in the select function that you think might be a predictor of students’ final course grade or useful in addressing our research question.</p>
<p>First, we need to figure out what variables exist in our dataset (or be reminded of this - it’s very common in R to be continually checking and inspecting your data)!</p>
<p>Recall that you can use a function named <code>glimpse()</code> to do this.</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb13"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="fu">glimpse</span>(sci_data)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>Rows: 603
Columns: 30
$ student_id <dbl> 43146, 44638, 47448, 47979, 48797, 51943, 52326,…
$ course_id <chr> "FrScA-S216-02", "OcnA-S116-01", "FrScA-S216-01"…
$ total_points_possible <dbl> 3280, 3531, 2870, 4562, 2207, 4208, 4325, 2086, …
$ total_points_earned <dbl> 2220, 2672, 1897, 3090, 1910, 3596, 2255, 1719, …
$ percentage_earned <dbl> 0.6768293, 0.7567261, 0.6609756, 0.6773345, 0.86…
$ subject <chr> "FrScA", "OcnA", "FrScA", "OcnA", "PhysA", "FrSc…
$ semester <chr> "S216", "S116", "S216", "S216", "S116", "S216", …
$ section <chr> "02", "01", "01", "01", "01", "03", "01", "01", …
$ Gradebook_Item <chr> "POINTS EARNED & TOTAL COURSE POINTS", "ATTEMPTE…
$ Grade_Category <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
$ FinalGradeCEMS <dbl> 93.45372, 81.70184, 88.48758, 81.85260, 84.00000…
$ Points_Possible <dbl> 5, 10, 10, 5, 438, 5, 10, 10, 443, 5, 12, 10, 5,…
$ Points_Earned <dbl> NA, 10.00, NA, 4.00, 399.00, NA, NA, 10.00, 425.…
$ Gender <chr> "M", "F", "M", "M", "F", "F", "M", "F", "F", "M"…
$ q1 <dbl> 5, 4, 5, 5, 4, NA, 5, 3, 4, NA, NA, 4, 3, 5, NA,…
$ q2 <dbl> 4, 4, 4, 5, 3, NA, 5, 3, 3, NA, NA, 5, 3, 3, NA,…
$ q3 <dbl> 4, 3, 4, 3, 3, NA, 3, 3, 3, NA, NA, 3, 3, 5, NA,…
$ q4 <dbl> 5, 4, 5, 5, 4, NA, 5, 3, 4, NA, NA, 5, 3, 5, NA,…
$ q5 <dbl> 5, 4, 5, 5, 4, NA, 5, 3, 4, NA, NA, 5, 4, 5, NA,…
$ q6 <dbl> 5, 4, 4, 5, 4, NA, 5, 4, 3, NA, NA, 5, 3, 5, NA,…
$ q7 <dbl> 5, 4, 4, 4, 4, NA, 4, 3, 3, NA, NA, 5, 3, 5, NA,…
$ q8 <dbl> 5, 5, 5, 5, 4, NA, 5, 3, 4, NA, NA, 4, 3, 5, NA,…
$ q9 <dbl> 4, 4, 3, 5, NA, NA, 5, 3, 2, NA, NA, 5, 2, 2, NA…
$ q10 <dbl> 5, 4, 5, 5, 3, NA, 5, 3, 5, NA, NA, 4, 4, 5, NA,…
$ TimeSpent <dbl> 1555.1667, 1382.7001, 860.4335, 1598.6166, 1481.…
$ TimeSpent_hours <dbl> 25.91944500, 23.04500167, 14.34055833, 26.643610…
$ TimeSpent_std <dbl> -0.18051496, -0.30780313, -0.69325954, -0.148446…
$ int <dbl> 5.0, 4.2, 5.0, 5.0, 3.8, 4.6, 5.0, 3.0, 4.2, NA,…
$ pc <dbl> 4.50, 3.50, 4.00, 3.50, 3.50, 4.00, 3.50, 3.00, …
$ uv <dbl> 4.333333, 4.000000, 3.666667, 5.000000, 3.500000…</code></pre>
</div>
</div>
</section>
<section id="your-turn-8" class="level4">
<h4 class="anchored" data-anchor-id="your-turn-8">👉 Your Turn ⤵</h4>
<p>In the code chunk below, add a new variable, being careful to type the new variable name as it appears in the data. We’ve added some code to get you started. Consider how the names of the other variables are separated as you think about how to add an additional variable to this code.</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb15"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a>sci_data <span class="sc">|></span> </span>
<span id="cb15-2"><a href="#cb15-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">select</span>(FinalGradeCEMS, TimeSpent, total_points_earned)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code># A tibble: 603 × 3
FinalGradeCEMS TimeSpent total_points_earned
<dbl> <dbl> <dbl>
1 93.5 1555. 2220
2 81.7 1383. 2672
3 88.5 860. 1897
4 81.9 1599. 3090
5 84 1482. 1910
6 NA 3.45 3596
7 83.6 1322. 2255
8 97.8 1390. 1719
9 96.1 1479. 3149
10 NA NA 1402
# ℹ 593 more rows</code></pre>
</div>
</div>
<p>Once added, the output should be different than in the code above - there should now be an additional variable included in the print-out.</p>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Note
</div>
</div>
<div class="callout-body-container callout-body">
<p><strong>A quick footnote about pipes</strong>: The original pipe operator, <code>%>%</code>, comes from the {<a href="https://magrittr.tidyverse.org">magrittr</a>} package but all packages in the tidyverse load <code>%>%</code> for you automatically, so you don’t usually load magrittr explicitly. The pipe has become such a useful and much used operator in R that it is now baked into R using the new and simpler native pipe <code>|></code> operator. You can use both fairly interchangeably but there are a few <a href="https://www.tidyverse.org/blog/2023/04/base-vs-magrittr-pipe/">differences between pipe operators</a>.</p>
</div>
</div>
</section>
</section>
<section id="filtering-variables" class="level3">
<h3 class="anchored" data-anchor-id="filtering-variables">Filtering variables</h3>
<p>Next, let’s explore filtering variables.</p>
<section id="your-turn-9" class="level4">
<h4 class="anchored" data-anchor-id="your-turn-9">👉 Your Turn ⤵</h4>
<p>Check out and run the next chunk of code, imagining that we wish to filter our data to view only the rows associated with students who earned a final grade (as a percentage) of 70 - 70% - or higher.</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb17"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a>sci_data <span class="sc">|></span> </span>
<span id="cb17-2"><a href="#cb17-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">filter</span>(FinalGradeCEMS <span class="sc">></span> <span class="dv">70</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code># A tibble: 438 × 30
student_id course_id total_points_possible total_points_earned
<dbl> <chr> <dbl> <dbl>
1 43146 FrScA-S216-02 3280 2220
2 44638 OcnA-S116-01 3531 2672
3 47448 FrScA-S216-01 2870 1897
4 47979 OcnA-S216-01 4562 3090
5 48797 PhysA-S116-01 2207 1910
6 52326 AnPhA-S216-01 4325 2255
7 52446 PhysA-S116-01 2086 1719
8 53447 FrScA-S116-01 4655 3149
9 53475 FrScA-S216-01 1209 977
10 54066 OcnA-S116-01 4641 3429
# ℹ 428 more rows
# ℹ 26 more variables: percentage_earned <dbl>, subject <chr>, semester <chr>,
# section <chr>, Gradebook_Item <chr>, Grade_Category <lgl>,
# FinalGradeCEMS <dbl>, Points_Possible <dbl>, Points_Earned <dbl>,
# Gender <chr>, q1 <dbl>, q2 <dbl>, q3 <dbl>, q4 <dbl>, q5 <dbl>, q6 <dbl>,
# q7 <dbl>, q8 <dbl>, q9 <dbl>, q10 <dbl>, TimeSpent <dbl>,
# TimeSpent_hours <dbl>, TimeSpent_std <dbl>, int <dbl>, pc <dbl>, uv <dbl></code></pre>
</div>
</div>
<p>In the next code chunk, change the cut-off from 70% to some other value - larger or smaller (maybe much larger or smaller - feel free to play around with the code a bit!).</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb19"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a>sci_data <span class="sc">|></span> </span>
<span id="cb19-2"><a href="#cb19-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">filter</span>(FinalGradeCEMS <span class="sc">></span> <span class="dv">70</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code># A tibble: 438 × 30
student_id course_id total_points_possible total_points_earned
<dbl> <chr> <dbl> <dbl>
1 43146 FrScA-S216-02 3280 2220
2 44638 OcnA-S116-01 3531 2672
3 47448 FrScA-S216-01 2870 1897
4 47979 OcnA-S216-01 4562 3090
5 48797 PhysA-S116-01 2207 1910
6 52326 AnPhA-S216-01 4325 2255
7 52446 PhysA-S116-01 2086 1719
8 53447 FrScA-S116-01 4655 3149
9 53475 FrScA-S216-01 1209 977
10 54066 OcnA-S116-01 4641 3429
# ℹ 428 more rows
# ℹ 26 more variables: percentage_earned <dbl>, subject <chr>, semester <chr>,
# section <chr>, Gradebook_Item <chr>, Grade_Category <lgl>,
# FinalGradeCEMS <dbl>, Points_Possible <dbl>, Points_Earned <dbl>,
# Gender <chr>, q1 <dbl>, q2 <dbl>, q3 <dbl>, q4 <dbl>, q5 <dbl>, q6 <dbl>,
# q7 <dbl>, q8 <dbl>, q9 <dbl>, q10 <dbl>, TimeSpent <dbl>,
# TimeSpent_hours <dbl>, TimeSpent_std <dbl>, int <dbl>, pc <dbl>, uv <dbl></code></pre>
</div>
</div>
</section>
<section id="question-3" class="level4">
<h4 class="anchored" data-anchor-id="question-3">❓Question</h4>
<p>What happens when you change the cut-off from 70 to something else? Add a thought (or more) below:</p>
<ul>
<li>YOUR RESPONSE HERE</li>
</ul>
</section>
</section>
<section id="arrange" class="level3">
<h3 class="anchored" data-anchor-id="arrange">Arrange</h3>
<p>The last function we’ll use for preparing tables is arrange, which allows us to sort columns in ascending (default) or descending order. We’ll again use the <code>|></code> to combine this <code>arrange()</code> function with a function we used already - <code>select()</code>. We do this so we can view only time spent and final grades.</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb21"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb21-1"><a href="#cb21-1" aria-hidden="true" tabindex="-1"></a>sci_data <span class="sc">|></span> </span>
<span id="cb21-2"><a href="#cb21-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">select</span>(FinalGradeCEMS, TimeSpent) <span class="sc">|></span> </span>
<span id="cb21-3"><a href="#cb21-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">arrange</span>(FinalGradeCEMS)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code># A tibble: 603 × 2
FinalGradeCEMS TimeSpent
<dbl> <dbl>
1 0 13.9
2 0.535 306.
3 0.903 88.5
4 1.80 44.7
5 2.93 57.7
6 3.01 571.
7 3.06 0.7
8 3.43 245.
9 5.04 202.
10 5.2 11.0
# ℹ 593 more rows</code></pre>
</div>
</div>
<p>Note that arrange works by sorting values in ascending order (from lowest to highest) by default; you can change this by using the <code>desc()</code> function as an argument with arrange, like the following:</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb23"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb23-1"><a href="#cb23-1" aria-hidden="true" tabindex="-1"></a>sci_data <span class="sc">|></span> </span>
<span id="cb23-2"><a href="#cb23-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">select</span>(FinalGradeCEMS, TimeSpent) <span class="sc">|></span> </span>
<span id="cb23-3"><a href="#cb23-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">arrange</span>(<span class="fu">desc</span>(FinalGradeCEMS))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code># A tibble: 603 × 2
FinalGradeCEMS TimeSpent
<dbl> <dbl>
1 100 2689.
2 99.8 2921.
3 99.3 965.
4 99.1 879.
5 99.0 1770.
6 98.6 1138.
7 98.6 1270.
8 98.6 1273.
9 98.2 1902.
10 98.2 5373.
# ℹ 593 more rows</code></pre>
</div>
</div>
<p>Just at a quick cursory glance at our two variables, it does appear that students with higher grades also tend to have spent more time in the online course.</p>
<section id="your-turn-10" class="level4">
<h4 class="anchored" data-anchor-id="your-turn-10">👉 Your Turn ⤵</h4>
<p>In the code chunk below, replace <code>FinalGradeCEMS</code> that is used with both the <code>select()</code> and <code>arrange()</code> functions with a different variable in the data set. Consider returning to the code chunk above in which you glimpsed at the names of all of the variables.</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb25"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb25-1"><a href="#cb25-1" aria-hidden="true" tabindex="-1"></a>sci_data <span class="sc">|></span> </span>
<span id="cb25-2"><a href="#cb25-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">select</span>(TimeSpent, FinalGradeCEMS) <span class="sc">|></span> </span>
<span id="cb25-3"><a href="#cb25-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">arrange</span>(<span class="fu">desc</span>(FinalGradeCEMS))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code># A tibble: 603 × 2
TimeSpent FinalGradeCEMS
<dbl> <dbl>
1 2689. 100
2 2921. 99.8
3 965. 99.3
4 879. 99.1
5 1770. 99.0
6 1138. 98.6
7 1270. 98.6
8 1273. 98.6
9 1902. 98.2
10 5373. 98.2
# ℹ 593 more rows</code></pre>
</div>
</div>
<p>Can you compose a series of functions that include the <code>select()</code>, <code>filter()</code>, and <code>arrange()</code> functions? Recall that you can “pipe” the output from one function to the next as when we used <code>select()</code> and <code>arrange()</code> together in the code chunk above.</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb27"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb27-1"><a href="#cb27-1" aria-hidden="true" tabindex="-1"></a>sci_data <span class="sc">|></span> </span>
<span id="cb27-2"><a href="#cb27-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">select</span>(TimeSpent, FinalGradeCEMS) <span class="sc">|></span> </span>
<span id="cb27-3"><a href="#cb27-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">filter</span>(FinalGradeCEMS <span class="sc">></span> <span class="dv">70</span>) <span class="sc">|></span> </span>
<span id="cb27-4"><a href="#cb27-4" aria-hidden="true" tabindex="-1"></a> <span class="fu">arrange</span>(FinalGradeCEMS)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code># A tibble: 438 × 2
TimeSpent FinalGradeCEMS
<dbl> <dbl>
1 1480. 70.2
2 764. 70.4
3 608. 70.5
4 536. 70.6
5 2497. 70.6
6 232. 70.7
7 1665. 70.9
8 1075. 71.0
9 1978. 71.3
10 2774. 71.5
# ℹ 428 more rows</code></pre>
</div>
</div>
</section>
</section>
</section>
<section id="explore" class="level2">
<h2 class="anchored" data-anchor-id="explore">3. EXPLORE</h2>
<p>Exploratory data analysis, or exploring your data, involves processes of <em>describing</em> your data (such as by calculating the means and standard deviations of numeric variables, or counting the frequency of categorical variables) and, often, visualizing your data. As we’ll learn in later labs, the explore phase can also involve the process of “feature engineering,” or creating new variables within a dataset <span class="citation" data-cites="krumm2018">(<a href="#ref-krumm2018" role="doc-biblioref">Krumm, Means, and Bienkowski 2018</a>)</span>.</p>
<p>In this section, we’ll quickly pull together some basic stats for our two variables of interest, <code>TimeSpent</code> and <code>FinalGradeCEMS</code>, using a handy function from the {skimr} package. We’ll also introduce you to a basic data visualization “code template” for the {<a href="https://ggplot2.tidyverse.org">ggplot</a>} package from the tidyverse to help us examine the relationship between these two variables.</p>
<section id="summary-statistics" class="level3">
<h3 class="anchored" data-anchor-id="summary-statistics">Summary Statistics</h3>
<p>Let’s repurpose what we learned from our wrangle section to select just a few variables and quickly gather some descriptive stats using the <code>skim()</code> function from the {skimr} package.</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb29"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb29-1"><a href="#cb29-1" aria-hidden="true" tabindex="-1"></a>sci_data <span class="sc">|></span></span>
<span id="cb29-2"><a href="#cb29-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">select</span>(TimeSpent, FinalGradeCEMS) <span class="sc">|></span></span>
<span id="cb29-3"><a href="#cb29-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">skim</span>()</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output-display">
<table class="table table-sm table-striped small">
<caption>Data summary</caption>
<tbody>
<tr class="odd">
<td style="text-align: left;">Name</td>
<td style="text-align: left;">select(sci_data, TimeSpen…</td>
</tr>
<tr class="even">
<td style="text-align: left;">Number of rows</td>
<td style="text-align: left;">603</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Number of columns</td>
<td style="text-align: left;">2</td>
</tr>
<tr class="even">
<td style="text-align: left;">_______________________</td>
<td style="text-align: left;"></td>
</tr>
<tr class="odd">
<td style="text-align: left;">Column type frequency:</td>
<td style="text-align: left;"></td>
</tr>
<tr class="even">
<td style="text-align: left;">numeric</td>
<td style="text-align: left;">2</td>
</tr>
<tr class="odd">
<td style="text-align: left;">________________________</td>
<td style="text-align: left;"></td>
</tr>
<tr class="even">
<td style="text-align: left;">Group variables</td>
<td style="text-align: left;">None</td>
</tr>
</tbody>
</table>
<p><strong>Variable type: numeric</strong></p>
<table class="table table-sm table-striped small">
<colgroup>
<col style="width: 15%">
<col style="width: 10%">
<col style="width: 14%">
<col style="width: 8%">
<col style="width: 8%">
<col style="width: 5%">
<col style="width: 7%">
<col style="width: 8%">
<col style="width: 8%">
<col style="width: 8%">
<col style="width: 6%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">skim_variable</th>
<th style="text-align: right;">n_missing</th>
<th style="text-align: right;">complete_rate</th>
<th style="text-align: right;">mean</th>
<th style="text-align: right;">sd</th>
<th style="text-align: right;">p0</th>
<th style="text-align: right;">p25</th>
<th style="text-align: right;">p50</th>
<th style="text-align: right;">p75</th>
<th style="text-align: right;">p100</th>
<th style="text-align: left;">hist</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">TimeSpent</td>
<td style="text-align: right;">5</td>
<td style="text-align: right;">0.99</td>
<td style="text-align: right;">1799.75</td>
<td style="text-align: right;">1354.93</td>
<td style="text-align: right;">0.45</td>
<td style="text-align: right;">851.90</td>
<td style="text-align: right;">1550.91</td>
<td style="text-align: right;">2426.09</td>
<td style="text-align: right;">8870.88</td>
<td style="text-align: left;">▇▅▁▁▁</td>
</tr>
<tr class="even">
<td style="text-align: left;">FinalGradeCEMS</td>
<td style="text-align: right;">30</td>
<td style="text-align: right;">0.95</td>
<td style="text-align: right;">77.20</td>
<td style="text-align: right;">22.23</td>
<td style="text-align: right;">0.00</td>
<td style="text-align: right;">71.25</td>
<td style="text-align: right;">84.57</td>
<td style="text-align: right;">92.10</td>
<td style="text-align: right;">100.00</td>
<td style="text-align: left;">▁▁▁▃▇</td>
</tr>
</tbody>
</table>
</div>
</div>
<section id="your-turn-11" class="level4">
<h4 class="anchored" data-anchor-id="your-turn-11">👉 Your Turn ⤵</h4>
<p>Use the code from the chunk from above to explore some other variables of interest from our <code>sci_data</code>.</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb30"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb30-1"><a href="#cb30-1" aria-hidden="true" tabindex="-1"></a>sci_data <span class="sc">|></span></span>
<span id="cb30-2"><a href="#cb30-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">select</span>(course_id, FinalGradeCEMS) <span class="sc">|></span></span>
<span id="cb30-3"><a href="#cb30-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">skim</span>()</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output-display">
<table class="table table-sm table-striped small">
<caption>Data summary</caption>
<tbody>
<tr class="odd">
<td style="text-align: left;">Name</td>
<td style="text-align: left;">select(sci_data, course_i…</td>
</tr>
<tr class="even">
<td style="text-align: left;">Number of rows</td>
<td style="text-align: left;">603</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Number of columns</td>
<td style="text-align: left;">2</td>
</tr>
<tr class="even">
<td style="text-align: left;">_______________________</td>
<td style="text-align: left;"></td>
</tr>
<tr class="odd">
<td style="text-align: left;">Column type frequency:</td>
<td style="text-align: left;"></td>
</tr>
<tr class="even">
<td style="text-align: left;">character</td>
<td style="text-align: left;">1</td>
</tr>
<tr class="odd">
<td style="text-align: left;">numeric</td>
<td style="text-align: left;">1</td>
</tr>