forked from cis-ds/course-site
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblock004_explore-data.html
More file actions
829 lines (754 loc) · 47 KB
/
block004_explore-data.html
File metadata and controls
829 lines (754 loc) · 47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />
<title>Exploratory data analysis</title>
<script src="site_libs/jquery-1.11.3/jquery.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="site_libs/bootstrap-3.3.5/css/readable.min.css" rel="stylesheet" />
<script src="site_libs/bootstrap-3.3.5/js/bootstrap.min.js"></script>
<script src="site_libs/bootstrap-3.3.5/shim/html5shiv.min.js"></script>
<script src="site_libs/bootstrap-3.3.5/shim/respond.min.js"></script>
<script src="site_libs/jqueryui-1.11.4/jquery-ui.min.js"></script>
<link href="site_libs/tocify-1.9.1/jquery.tocify.css" rel="stylesheet" />
<script src="site_libs/tocify-1.9.1/jquery.tocify.js"></script>
<script src="site_libs/navigation-1.1/tabsets.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-45631879-2', 'auto');
ga('send', 'pageview');
</script>
<style type="text/css">code{white-space: pre;}</style>
<style type="text/css">
div.sourceCode { overflow-x: auto; }
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
margin: 0; padding: 0; vertical-align: baseline; border: none; }
table.sourceCode { width: 100%; line-height: 100%; }
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
td.sourceCode { padding-left: 5px; }
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
code > span.dt { color: #902000; } /* DataType */
code > span.dv { color: #40a070; } /* DecVal */
code > span.bn { color: #40a070; } /* BaseN */
code > span.fl { color: #40a070; } /* Float */
code > span.ch { color: #4070a0; } /* Char */
code > span.st { color: #4070a0; } /* String */
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
code > span.ot { color: #007020; } /* Other */
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
code > span.fu { color: #06287e; } /* Function */
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
code > span.cn { color: #880000; } /* Constant */
code > span.sc { color: #4070a0; } /* SpecialChar */
code > span.vs { color: #4070a0; } /* VerbatimString */
code > span.ss { color: #bb6688; } /* SpecialString */
code > span.im { } /* Import */
code > span.va { color: #19177c; } /* Variable */
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code > span.op { color: #666666; } /* Operator */
code > span.bu { } /* BuiltIn */
code > span.ex { } /* Extension */
code > span.pp { color: #bc7a00; } /* Preprocessor */
code > span.at { color: #7d9029; } /* Attribute */
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
</style>
<style type="text/css">
pre:not([class]) {
background-color: white;
}
</style>
<style type="text/css">
h1 {
font-size: 34px;
}
h1.title {
font-size: 38px;
}
h2 {
font-size: 30px;
}
h3 {
font-size: 24px;
}
h4 {
font-size: 18px;
}
h5 {
font-size: 16px;
}
h6 {
font-size: 12px;
}
.table th:not([align]) {
text-align: left;
}
</style>
</head>
<body>
<style type = "text/css">
.main-container {
max-width: 940px;
margin-left: auto;
margin-right: auto;
}
code {
color: inherit;
background-color: rgba(0, 0, 0, 0.04);
}
img {
max-width:100%;
height: auto;
}
.tabbed-pane {
padding-top: 12px;
}
button.code-folding-btn:focus {
outline: none;
}
</style>
<style type="text/css">
/* padding for bootstrap navbar */
body {
padding-top: 66px;
padding-bottom: 40px;
}
/* offset scroll position for anchor links (for fixed navbar) */
.section h1 {
padding-top: 71px;
margin-top: -71px;
}
.section h2 {
padding-top: 71px;
margin-top: -71px;
}
.section h3 {
padding-top: 71px;
margin-top: -71px;
}
.section h4 {
padding-top: 71px;
margin-top: -71px;
}
.section h5 {
padding-top: 71px;
margin-top: -71px;
}
.section h6 {
padding-top: 71px;
margin-top: -71px;
}
</style>
<script>
// manage active state of menu based on current page
$(document).ready(function () {
// active menu anchor
href = window.location.pathname
href = href.substr(href.lastIndexOf('/') + 1)
if (href === "")
href = "index.html";
var menuAnchor = $('a[href="' + href + '"]');
// mark it active
menuAnchor.parent().addClass('active');
// if it's got a parent navbar menu mark it active as well
menuAnchor.closest('li.dropdown').addClass('active');
});
</script>
<div class="container-fluid main-container">
<!-- tabsets -->
<script>
$(document).ready(function () {
window.buildTabsets("TOC");
});
</script>
<!-- code folding -->
<script>
$(document).ready(function () {
// move toc-ignore selectors from section div to header
$('div.section.toc-ignore')
.removeClass('toc-ignore')
.children('h1,h2,h3,h4,h5').addClass('toc-ignore');
// establish options
var options = {
selectors: "h1,h2,h3",
theme: "bootstrap3",
context: '.toc-content',
hashGenerator: function (text) {
return text.replace(/[.\\/?&!#<>]/g, '').replace(/\s/g, '_').toLowerCase();
},
ignoreSelector: ".toc-ignore",
scrollTo: 0
};
options.showAndHide = true;
options.smoothScroll = true;
// tocify
var toc = $("#TOC").tocify(options).data("toc-tocify");
});
</script>
<style type="text/css">
#TOC {
margin: 25px 0px 20px 0px;
}
@media (max-width: 768px) {
#TOC {
position: relative;
width: 100%;
}
}
.toc-content {
padding-left: 30px;
padding-right: 40px;
}
div.main-container {
max-width: 1200px;
}
div.tocify {
width: 20%;
max-width: 260px;
max-height: 85%;
}
@media (min-width: 768px) and (max-width: 991px) {
div.tocify {
width: 25%;
}
}
@media (max-width: 767px) {
div.tocify {
width: 100%;
max-width: none;
}
}
.tocify ul, .tocify li {
line-height: 20px;
}
.tocify-subheader .tocify-item {
font-size: 0.90em;
padding-left: 25px;
text-indent: 0;
}
.tocify .list-group-item {
border-radius: 0px;
}
</style>
<!-- setup 3col/9col grid for toc_float and main content -->
<div class="row-fluid">
<div class="col-xs-12 col-sm-4 col-md-3">
<div id="TOC" class="tocify">
</div>
</div>
<div class="toc-content col-xs-12 col-sm-8 col-md-9">
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">Computing for the Social Sciences</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="index.html">Home</a>
</li>
<li>
<a href="faq.html">FAQ</a>
</li>
<li>
<a href="syllabus.html">Syllabus</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
<div class="fluid-row" id="header">
<h1 class="title toc-ignore">Exploratory data analysis</h1>
</div>
<div id="objectives" class="section level1">
<h1>Objectives</h1>
<ul>
<li>Define <strong>exploratory data analysis</strong> (EDA) and types of pattern exploration</li>
<li>Demonstrate types of graphs useful for EDA and precautions when interpreting them</li>
<li>Practice transforming and exploring data using Department of Education College Scorecard data</li>
</ul>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">library</span>(tidyverse)</code></pre></div>
<pre><code>## Loading tidyverse: ggplot2
## Loading tidyverse: tibble
## Loading tidyverse: tidyr
## Loading tidyverse: readr
## Loading tidyverse: purrr
## Loading tidyverse: dplyr</code></pre>
<pre><code>## Conflicts with tidy packages ----------------------------------------------</code></pre>
<pre><code>## filter(): dplyr, stats
## lag(): dplyr, stats</code></pre>
</div>
<div id="exploratory-data-analysis-eda-and-types-of-pattern-exploration" class="section level1">
<h1>Exploratory data analysis (EDA) and types of pattern exploration</h1>
<div id="exploratory-data-analysis-process" class="section level2">
<h2>Exploratory data analysis process</h2>
<ol style="list-style-type: decimal">
<li>Generate questions about your data.</li>
<li>Search for answers by visualising, transforming, and modeling your data.</li>
<li>Use what you learn to refine your questions and or generate new questions.</li>
</ol>
<ul>
<li>Rinse and repeat until you publish a paper.</li>
</ul>
<p>EDA is fundamentally a creative process - it is not an exact science. It requires knowledge of your data and a lot of time. At the most basic level, it involves answering two questions</p>
<ol style="list-style-type: decimal">
<li>What type of <em>variation</em> occurs <em>within</em> my variables?</li>
<li>What type of <em>covariation</em> occurs <em>between</em> my variables?</li>
</ol>
</div>
<div id="visualizing-variation" class="section level2">
<h2>Visualizing variation</h2>
<div id="categorical-variables" class="section level3">
<h3>Categorical variables</h3>
<p>Variables with a fixed, discrete set of potential values. Typically visualized using a bar graph.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">ggplot</span>(<span class="dt">data =</span> diamonds) +
<span class="st"> </span><span class="kw">geom_bar</span>(<span class="dt">mapping =</span> <span class="kw">aes</span>(<span class="dt">x =</span> cut))</code></pre></div>
<p><img src="block004_explore-data_files/figure-html/unnamed-chunk-2-1.png" width="672" /></p>
<p><code>dplyr</code> and the <code>count()</code> function can be used to manually calculate each category’s frequency.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">diamonds %>%<span class="st"> </span>
<span class="st"> </span><span class="kw">count</span>(cut)</code></pre></div>
<pre><code>## # A tibble: 5 × 2
## cut n
## <ord> <int>
## 1 Fair 1610
## 2 Good 4906
## 3 Very Good 12082
## 4 Premium 13791
## 5 Ideal 21551</code></pre>
</div>
<div id="continuous-variables" class="section level3">
<h3>Continuous variables</h3>
<p>Continuous variables can take on any of an infinite set of ordered values. Histograms are used to visualize these distributions by “binning” the continuous values into discrete chunks, then drawing a bar chart for the corresponding chunks.</p>
<p>By default, <code>geom_histogram</code> divides the data into 30 discrete bins of equal width.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">ggplot</span>(<span class="dt">data =</span> diamonds) +
<span class="st"> </span><span class="kw">geom_histogram</span>(<span class="dt">mapping =</span> <span class="kw">aes</span>(<span class="dt">x =</span> carat))</code></pre></div>
<pre><code>## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.</code></pre>
<p><img src="block004_explore-data_files/figure-html/unnamed-chunk-4-1.png" width="672" /></p>
<p>The <code>binwidth</code> determines how large each bin will be. Different bin sizes may reveal different characteristics about the variable and can be manually set.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">ggplot</span>(<span class="dt">data =</span> diamonds) +
<span class="st"> </span><span class="kw">geom_histogram</span>(<span class="dt">mapping =</span> <span class="kw">aes</span>(<span class="dt">x =</span> carat), <span class="dt">binwidth =</span> <span class="fl">0.5</span>)</code></pre></div>
<p><img src="block004_explore-data_files/figure-html/unnamed-chunk-5-1.png" width="672" /></p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">ggplot</span>(<span class="dt">data =</span> diamonds) +
<span class="st"> </span><span class="kw">geom_histogram</span>(<span class="dt">mapping =</span> <span class="kw">aes</span>(<span class="dt">x =</span> carat), <span class="dt">binwidth =</span> <span class="fl">0.1</span>)</code></pre></div>
<p><img src="block004_explore-data_files/figure-html/unnamed-chunk-5-2.png" width="672" /></p>
</div>
<div id="detecting-outliers" class="section level3">
<h3>Detecting outliers</h3>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">ggplot</span>(diamonds) +<span class="st"> </span>
<span class="st"> </span><span class="kw">geom_histogram</span>(<span class="dt">mapping =</span> <span class="kw">aes</span>(<span class="dt">x =</span> y), <span class="dt">binwidth =</span> <span class="fl">0.5</span>)</code></pre></div>
<p><img src="block004_explore-data_files/figure-html/unnamed-chunk-6-1.png" width="672" /></p>
<p>Why does this graph have such a long tail on the right? Nothing appears to be out there.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">ggplot</span>(diamonds) +<span class="st"> </span>
<span class="st"> </span><span class="kw">geom_histogram</span>(<span class="dt">mapping =</span> <span class="kw">aes</span>(<span class="dt">x =</span> y), <span class="dt">binwidth =</span> <span class="fl">0.5</span>) +
<span class="st"> </span><span class="kw">coord_cartesian</span>(<span class="dt">ylim =</span> <span class="kw">c</span>(<span class="dv">0</span>, <span class="dv">50</span>))</code></pre></div>
<p><img src="block004_explore-data_files/figure-html/unnamed-chunk-7-1.png" width="672" /></p>
<p>Oh, there actually is something out there.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">diamonds %>%<span class="st"> </span>
<span class="st"> </span><span class="kw">filter</span>(y <<span class="st"> </span><span class="dv">3</span> |<span class="st"> </span>y ><span class="st"> </span><span class="dv">20</span>) %>%<span class="st"> </span>
<span class="st"> </span><span class="kw">arrange</span>(y)</code></pre></div>
<pre><code>## # A tibble: 9 × 10
## carat cut color clarity depth table price x y z
## <dbl> <ord> <ord> <ord> <dbl> <dbl> <int> <dbl> <dbl> <dbl>
## 1 1.00 Very Good H VS2 63.3 53 5139 0.00 0.0 0.00
## 2 1.14 Fair G VS1 57.5 67 6381 0.00 0.0 0.00
## 3 1.56 Ideal G VS2 62.2 54 12800 0.00 0.0 0.00
## 4 1.20 Premium D VVS1 62.1 59 15686 0.00 0.0 0.00
## 5 2.25 Premium H SI2 62.8 59 18034 0.00 0.0 0.00
## 6 0.71 Good F SI2 64.1 60 2130 0.00 0.0 0.00
## 7 0.71 Good F SI2 64.1 60 2130 0.00 0.0 0.00
## 8 0.51 Ideal E VS1 61.8 55 2075 5.15 31.8 5.12
## 9 2.00 Premium H SI2 58.9 57 12210 8.09 58.9 8.06</code></pre>
<p>What do we do with this knowledge? Do we exclude outliers because they are extremely different from the “normal” data? Do we concentrate on these outliers because they are the most interesting component? This is a judgment call on your part. Follow normal practices in your field, though I always am weary of throwing out data unless I have strong evidence it is simply miscoded.</p>
</div>
</div>
<div id="covariation" class="section level2">
<h2>Covariation</h2>
<div id="categorical-and-continuous-variable" class="section level3">
<h3>Categorical and continuous variable</h3>
<div id="frequency-polygon-line-chart-version-of-a-histrogram" class="section level4">
<h4>Frequency polygon (line chart version of a histrogram)</h4>
<p>With counts:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">ggplot</span>(<span class="dt">data =</span> diamonds, <span class="dt">mapping =</span> <span class="kw">aes</span>(<span class="dt">x =</span> price)) +<span class="st"> </span>
<span class="st"> </span><span class="kw">geom_freqpoly</span>(<span class="dt">mapping =</span> <span class="kw">aes</span>(<span class="dt">colour =</span> cut), <span class="dt">binwidth =</span> <span class="dv">500</span>)</code></pre></div>
<p><img src="block004_explore-data_files/figure-html/unnamed-chunk-9-1.png" width="672" /></p>
<p>With density (standardized count so that the area under each frequency polygon is one):</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">ggplot</span>(<span class="dt">data =</span> diamonds, <span class="dt">mapping =</span> <span class="kw">aes</span>(<span class="dt">x =</span> price, <span class="dt">y =</span> ..density..)) +<span class="st"> </span>
<span class="st"> </span><span class="kw">geom_freqpoly</span>(<span class="dt">mapping =</span> <span class="kw">aes</span>(<span class="dt">colour =</span> cut), <span class="dt">binwidth =</span> <span class="dv">500</span>)</code></pre></div>
<p><img src="block004_explore-data_files/figure-html/unnamed-chunk-10-1.png" width="672" /></p>
</div>
<div id="boxplot" class="section level4">
<h4>Boxplot</h4>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">ggplot</span>(<span class="dt">data =</span> diamonds, <span class="dt">mapping =</span> <span class="kw">aes</span>(<span class="dt">x =</span> cut, <span class="dt">y =</span> price)) +
<span class="st"> </span><span class="kw">geom_boxplot</span>()</code></pre></div>
<p><img src="block004_explore-data_files/figure-html/unnamed-chunk-11-1.png" width="672" /></p>
</div>
</div>
<div id="two-categorical-variables" class="section level3">
<h3>Two categorical variables</h3>
<p><code>geom_count()</code>:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">ggplot</span>(<span class="dt">data =</span> diamonds) +
<span class="st"> </span><span class="kw">geom_count</span>(<span class="dt">mapping =</span> <span class="kw">aes</span>(<span class="dt">x =</span> cut, <span class="dt">y =</span> color))</code></pre></div>
<p><img src="block004_explore-data_files/figure-html/unnamed-chunk-12-1.png" width="672" /></p>
<p><code>geom_tile()</code>:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">diamonds %>%<span class="st"> </span>
<span class="st"> </span><span class="kw">count</span>(color, cut) %>%<span class="st"> </span>
<span class="st"> </span><span class="kw">ggplot</span>(<span class="dt">mapping =</span> <span class="kw">aes</span>(<span class="dt">x =</span> color, <span class="dt">y =</span> cut)) +
<span class="st"> </span><span class="kw">geom_tile</span>(<span class="dt">mapping =</span> <span class="kw">aes</span>(<span class="dt">fill =</span> n))</code></pre></div>
<p><img src="block004_explore-data_files/figure-html/unnamed-chunk-13-1.png" width="672" /></p>
</div>
<div id="two-continuous-variables" class="section level3">
<h3>Two continuous variables</h3>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">ggplot</span>(<span class="dt">data =</span> diamonds) +
<span class="st"> </span><span class="kw">geom_point</span>(<span class="dt">mapping =</span> <span class="kw">aes</span>(<span class="dt">x =</span> carat, <span class="dt">y =</span> price))</code></pre></div>
<p><img src="block004_explore-data_files/figure-html/unnamed-chunk-14-1.png" width="672" /></p>
<div id="avoid-overlap-of-points" class="section level4">
<h4>Avoid overlap of points</h4>
<div id="use-alpha-aesthetic-to-change-transparency" class="section level5">
<h5>Use <code>alpha</code> aesthetic to change transparency</h5>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">ggplot</span>(<span class="dt">data =</span> diamonds) +
<span class="st"> </span><span class="kw">geom_point</span>(<span class="dt">mapping =</span> <span class="kw">aes</span>(<span class="dt">x =</span> carat, <span class="dt">y =</span> price), <span class="dt">alpha =</span> .<span class="dv">2</span>)</code></pre></div>
<p><img src="block004_explore-data_files/figure-html/unnamed-chunk-15-1.png" width="672" /></p>
</div>
<div id="add-a-smoothing-line" class="section level5">
<h5>Add a smoothing line</h5>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">ggplot</span>(<span class="dt">data =</span> diamonds, <span class="dt">mapping =</span> <span class="kw">aes</span>(<span class="dt">x =</span> carat, <span class="dt">y =</span> price)) +
<span class="st"> </span><span class="kw">geom_point</span>() +
<span class="st"> </span><span class="kw">geom_smooth</span>()</code></pre></div>
<pre><code>## `geom_smooth()` using method = 'gam'</code></pre>
<p><img src="block004_explore-data_files/figure-html/unnamed-chunk-16-1.png" width="672" /></p>
</div>
<div id="bin-the-data" class="section level5">
<h5>Bin the data</h5>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">ggplot</span>(<span class="dt">data =</span> diamonds) +
<span class="st"> </span><span class="kw">geom_bin2d</span>(<span class="dt">mapping =</span> <span class="kw">aes</span>(<span class="dt">x =</span> carat, <span class="dt">y =</span> price))</code></pre></div>
<p><img src="block004_explore-data_files/figure-html/unnamed-chunk-17-1.png" width="672" /></p>
</div>
</div>
</div>
</div>
</div>
<div id="resources-for-exploring-and-visualizing-data" class="section level1">
<h1>Resources for exploring and visualizing data</h1>
<p><a href="https://www.rstudio.com/wp-content/uploads/2015/12/ggplot2-cheatsheet-2.0.pdf"><strong>Data Visualization with <code>ggplot2</code> Cheat Sheet</strong></a> - print this cheatsheet off! It is a great guide for implementing functions from <code>ggplot2</code>. I strongly encourage you to refer to the first page. If you ever wonder what type of graph is appropriate for the variables you wish to visualize, this chart will guide you a graph that makes sense given the number and type (continuous vs. discrete) of variables.</p>
</div>
<div id="exploring-college-education" class="section level1">
<h1>Exploring college education</h1>
<p>The Department of Education collects <a href="https://collegescorecard.ed.gov/">annual statistics on colleges and universities in the United States</a>. I have included a subset of this data from 2013 in the <a href="https://github.com/uc-cfss/rcfss"><code>rcfss</code></a> library from GitHub. To install the package, run the command <code>devtools::install_github("uc-cfss/rcfss")</code> in the console.</p>
<blockquote>
<p>If you don’t already have the <code>devtools</code> library installed, you will get an error. Go back and install this first using <code>install.packages("devtools")</code>, then run <code>devtools::install_github("uc-cfss/rcfss")</code>.</p>
</blockquote>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">library</span>(rcfss)
<span class="kw">data</span>(<span class="st">"scorecard"</span>)
scorecard</code></pre></div>
<pre><code>## # A tibble: 1,849 × 12
## unitid name state type
## <int> <chr> <chr> <chr>
## 1 450234 ITT Technical Institute-Wichita KS Private, for-profit
## 2 448479 ITT Technical Institute-Swartz Creek MI Private, for-profit
## 3 456427 ITT Technical Institute-Concord CA Private, for-profit
## 4 459596 ITT Technical Institute-Tallahassee FL Private, for-profit
## 5 459851 Herzing University-Brookfield WI Private, for-profit
## 6 482477 DeVry University-Illinois IL Private, for-profit
## 7 482547 DeVry University-Nevada NV Private, for-profit
## 8 482592 DeVry University-Oregon OR Private, for-profit
## 9 482617 DeVry University-Tennessee TN Private, for-profit
## 10 482662 DeVry University-Washington WA Private, for-profit
## # ... with 1,839 more rows, and 8 more variables: cost <int>,
## # admrate <dbl>, satavg <dbl>, avgfacsal <dbl>, pctpell <dbl>,
## # comprate <dbl>, firstgen <dbl>, debt <dbl></code></pre>
<p>Type <code>?scorecard</code> in the console to open up the help file for this data set. This includes the documentation for all the variables. Use your knowledge of <code>dplyr</code> and <code>ggplot2</code> functions to answer the following questions.</p>
<div id="which-type-of-college-has-the-highest-average-sat-score" class="section level3">
<h3>Which type of college has the highest average SAT score?</h3>
<p><strong>NOTE: This time, use a graph to visualize your answer, <a href="block003_transform-data.html#which_type_of_college_has_the_highest_average_sat_score">not a table</a>.</strong></p>
<details> <summary>Click for the solution</summary>
<p>
<p>We could use a <strong>boxplot</strong> to visualize the distribution of SAT scores.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">ggplot</span>(scorecard, <span class="kw">aes</span>(type, satavg)) +
<span class="st"> </span><span class="kw">geom_boxplot</span>()</code></pre></div>
<pre><code>## Warning: Removed 471 rows containing non-finite values (stat_boxplot).</code></pre>
<p><img src="block004_explore-data_files/figure-html/unnamed-chunk-19-1.png" width="672" /></p>
<p>According to this private, nonprofit schools have the highest average SAT score, followed by public and then private, for-profit schools. But this doesn’t reveal the entire picture. What happens if we plot a <strong>histogram</strong> or <strong>frequency polygon</strong>?</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">ggplot</span>(scorecard, <span class="kw">aes</span>(satavg)) +
<span class="st"> </span><span class="kw">geom_histogram</span>() +
<span class="st"> </span><span class="kw">facet_wrap</span>(~<span class="st"> </span>type)</code></pre></div>
<pre><code>## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.</code></pre>
<pre><code>## Warning: Removed 471 rows containing non-finite values (stat_bin).</code></pre>
<p><img src="block004_explore-data_files/figure-html/unnamed-chunk-20-1.png" width="672" /></p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">ggplot</span>(scorecard, <span class="kw">aes</span>(satavg, <span class="dt">color =</span> type)) +
<span class="st"> </span><span class="kw">geom_freqpoly</span>()</code></pre></div>
<pre><code>## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.</code></pre>
<pre><code>## Warning: Removed 471 rows containing non-finite values (stat_bin).</code></pre>
<p><img src="block004_explore-data_files/figure-html/unnamed-chunk-20-2.png" width="672" /></p>
<p>Now we can see the averages for each college type are based on widely varying sample sizes.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">ggplot</span>(scorecard, <span class="kw">aes</span>(type)) +
<span class="st"> </span><span class="kw">geom_bar</span>()</code></pre></div>
<p><img src="block004_explore-data_files/figure-html/unnamed-chunk-21-1.png" width="672" /></p>
There are far fewer private, for-profit colleges than the other categories. A boxplot alone would not reveal this detail, which could be important in future analysis.
</p>
<p></details></p>
</div>
<div id="what-is-the-relationship-between-college-attendance-cost-and-faculty-salaries-how-does-this-relationship-differ-across-types-of-colleges" class="section level3">
<h3>What is the relationship between college attendance cost and faculty salaries? How does this relationship differ across types of colleges?</h3>
<details> <summary>Click for the solution</summary>
<p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="co"># geom_point</span>
<span class="kw">ggplot</span>(scorecard, <span class="kw">aes</span>(cost, avgfacsal)) +
<span class="st"> </span><span class="kw">geom_point</span>() +
<span class="st"> </span><span class="kw">geom_smooth</span>()</code></pre></div>
<pre><code>## `geom_smooth()` using method = 'gam'</code></pre>
<pre><code>## Warning: Removed 42 rows containing non-finite values (stat_smooth).</code></pre>
<pre><code>## Warning: Removed 42 rows containing missing values (geom_point).</code></pre>
<p><img src="block004_explore-data_files/figure-html/unnamed-chunk-22-1.png" width="672" /></p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="co"># geom_point with alpha transparency to reveal dense clusters</span>
<span class="kw">ggplot</span>(scorecard, <span class="kw">aes</span>(cost, avgfacsal)) +
<span class="st"> </span><span class="kw">geom_point</span>(<span class="dt">alpha =</span> .<span class="dv">2</span>) +
<span class="st"> </span><span class="kw">geom_smooth</span>()</code></pre></div>
<pre><code>## `geom_smooth()` using method = 'gam'</code></pre>
<pre><code>## Warning: Removed 42 rows containing non-finite values (stat_smooth).
## Warning: Removed 42 rows containing missing values (geom_point).</code></pre>
<p><img src="block004_explore-data_files/figure-html/unnamed-chunk-22-2.png" width="672" /></p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="co"># geom_hex</span>
<span class="kw">ggplot</span>(scorecard, <span class="kw">aes</span>(cost, avgfacsal)) +
<span class="st"> </span><span class="kw">geom_hex</span>() +
<span class="st"> </span><span class="kw">geom_smooth</span>()</code></pre></div>
<pre><code>## Warning: Removed 42 rows containing non-finite values (stat_binhex).</code></pre>
<pre><code>## `geom_smooth()` using method = 'gam'</code></pre>
<pre><code>## Warning: Removed 42 rows containing non-finite values (stat_smooth).</code></pre>
<p><img src="block004_explore-data_files/figure-html/unnamed-chunk-22-3.png" width="672" /></p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="co"># geom_point with smoothing lines for each type</span>
<span class="kw">ggplot</span>(scorecard, <span class="kw">aes</span>(cost, avgfacsal, <span class="dt">color =</span> type)) +
<span class="st"> </span><span class="kw">geom_point</span>(<span class="dt">alpha =</span> .<span class="dv">2</span>) +
<span class="st"> </span><span class="kw">geom_smooth</span>()</code></pre></div>
<pre><code>## `geom_smooth()` using method = 'gam'</code></pre>
<pre><code>## Warning: Removed 42 rows containing non-finite values (stat_smooth).
## Warning: Removed 42 rows containing missing values (geom_point).</code></pre>
<p><img src="block004_explore-data_files/figure-html/unnamed-chunk-22-4.png" width="672" /></p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="co"># geom_point with facets for each type</span>
<span class="kw">ggplot</span>(scorecard, <span class="kw">aes</span>(cost, avgfacsal, <span class="dt">color =</span> type)) +
<span class="st"> </span><span class="kw">geom_point</span>(<span class="dt">alpha =</span> .<span class="dv">2</span>) +
<span class="st"> </span><span class="kw">geom_smooth</span>() +
<span class="st"> </span><span class="kw">facet_grid</span>(. ~<span class="st"> </span>type)</code></pre></div>
<pre><code>## `geom_smooth()` using method = 'gam'</code></pre>
<pre><code>## Warning: Removed 42 rows containing non-finite values (stat_smooth).
## Warning: Removed 42 rows containing missing values (geom_point).</code></pre>
<p><img src="block004_explore-data_files/figure-html/unnamed-chunk-22-5.png" width="672" /></p>
</p>
<p></details></p>
</div>
<div id="how-are-a-colleges-pell-grant-recipients-related-to-the-average-students-education-debt" class="section level3">
<h3>How are a college’s Pell Grant recipients related to the average student’s education debt?</h3>
<details> <summary>Click for the solution</summary>
<p>
<p>Two continuous variables suggest a <strong>scatterplot</strong> would be appropriate.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">ggplot</span>(scorecard, <span class="kw">aes</span>(pctpell, debt)) +
<span class="st"> </span><span class="kw">geom_point</span>()</code></pre></div>
<pre><code>## Warning: Removed 75 rows containing missing values (geom_point).</code></pre>
<p><img src="block004_explore-data_files/figure-html/unnamed-chunk-23-1.png" width="672" /></p>
<p>Hmm. There seem to be a lot of data points. It isn’t really clear if there is a trend. What if we <strong>jitter</strong> the data points?</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">ggplot</span>(scorecard, <span class="kw">aes</span>(pctpell, debt)) +
<span class="st"> </span><span class="kw">geom_jitter</span>()</code></pre></div>
<pre><code>## Warning: Removed 75 rows containing missing values (geom_point).</code></pre>
<p><img src="block004_explore-data_files/figure-html/unnamed-chunk-24-1.png" width="672" /></p>
<p>Meh, didn’t really do much. What if we make our data points semi-transparent using the <code>alpha</code> aesthetic?</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">ggplot</span>(scorecard, <span class="kw">aes</span>(pctpell, debt)) +
<span class="st"> </span><span class="kw">geom_point</span>(<span class="dt">alpha =</span> .<span class="dv">2</span>)</code></pre></div>
<pre><code>## Warning: Removed 75 rows containing missing values (geom_point).</code></pre>
<p><img src="block004_explore-data_files/figure-html/unnamed-chunk-25-1.png" width="672" /></p>
<p>Now we’re getting somewhere. I’m beginning to see some dense clusters in the middle. Maybe a <strong>hexagon binning</strong> plot would help</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">ggplot</span>(scorecard, <span class="kw">aes</span>(pctpell, debt)) +
<span class="st"> </span><span class="kw">geom_hex</span>()</code></pre></div>
<pre><code>## Warning: Removed 75 rows containing non-finite values (stat_binhex).</code></pre>
<p><img src="block004_explore-data_files/figure-html/unnamed-chunk-26-1.png" width="672" /></p>
<p>This is getting better. It looks like there might be a downward trend; that is, as the percentage of Pell grant recipients increases, average student debt decreases. Let’s confirm this by going back to the scatterplot and overlaying a <strong>smoothing line</strong>.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">ggplot</span>(scorecard, <span class="kw">aes</span>(pctpell, debt)) +
<span class="st"> </span><span class="kw">geom_point</span>(<span class="dt">alpha =</span> .<span class="dv">2</span>) +
<span class="st"> </span><span class="kw">geom_smooth</span>()</code></pre></div>
<pre><code>## `geom_smooth()` using method = 'gam'</code></pre>
<pre><code>## Warning: Removed 75 rows containing non-finite values (stat_smooth).</code></pre>
<pre><code>## Warning: Removed 75 rows containing missing values (geom_point).</code></pre>
<p><img src="block004_explore-data_files/figure-html/unnamed-chunk-27-1.png" width="672" /></p>
<p>This confirms our initial evidence - there is an apparent negative relationship. Notice how I iterated through several different plots before I created one that provided the most informative visualization. <strong>You will not create the perfect graph on your first attempt.</strong> Trial and error is necessary in this exploratory stage. Be prepared to revise your code again and again.</p>
</p>
<p></details></p>
</div>
</div>
<div id="session-info" class="section level1 toc-ignore">
<h1>Session Info</h1>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">devtools::<span class="kw">session_info</span>()</code></pre></div>
<pre><code>## Session info --------------------------------------------------------------</code></pre>
<pre><code>## setting value
## version R version 3.3.2 (2016-10-31)
## system x86_64, darwin13.4.0
## ui RStudio (1.0.136)
## language (EN)
## collate en_US.UTF-8
## tz America/Chicago
## date 2017-03-06</code></pre>
<pre><code>## Packages ------------------------------------------------------------------</code></pre>
<pre><code>## package * version date source
## assertthat 0.1 2013-12-06 CRAN (R 3.3.0)
## backports 1.0.5 2017-01-18 CRAN (R 3.3.2)
## base64enc 0.1-3 2015-07-28 CRAN (R 3.3.0)
## bigrquery * 0.3.0 2016-06-28 CRAN (R 3.3.0)
## bitops 1.0-6 2013-08-17 CRAN (R 3.3.0)
## boot * 1.3-18 2016-02-23 CRAN (R 3.3.2)
## broom * 0.4.2 2017-02-13 CRAN (R 3.3.2)
## car 2.1-4 2016-12-02 CRAN (R 3.3.2)
## caret * 6.0-73 2016-11-10 CRAN (R 3.3.2)
## class 7.3-14 2015-08-30 CRAN (R 3.3.2)
## codetools 0.2-15 2016-10-05 CRAN (R 3.3.2)
## colorspace 1.3-2 2016-12-14 CRAN (R 3.3.2)
## curl * 2.3 2016-11-24 CRAN (R 3.3.2)
## DBI 0.5-1 2016-09-10 CRAN (R 3.3.0)
## devtools 1.12.0 2016-06-24 CRAN (R 3.3.0)
## digest 0.6.12 2017-01-27 CRAN (R 3.3.2)
## dplyr * 0.5.0 2016-06-24 CRAN (R 3.3.0)
## e1071 * 1.6-8 2017-02-02 CRAN (R 3.3.2)
## evaluate 0.10 2016-10-11 CRAN (R 3.3.0)
## FNN * 1.1 2013-07-31 CRAN (R 3.3.0)
## forcats * 0.2.0 2017-01-23 CRAN (R 3.3.2)
## foreach * 1.4.3 2015-10-13 CRAN (R 3.3.0)
## foreign 0.8-67 2016-09-13 CRAN (R 3.3.2)
## gam * 1.14 2016-09-10 CRAN (R 3.3.0)
## gapminder * 0.2.0 2015-12-31 CRAN (R 3.3.0)
## gbm * 2.1.1 2015-03-11 CRAN (R 3.3.0)
## geosphere 1.5-5 2016-06-15 CRAN (R 3.3.0)
## ggmap * 2.7 2016-12-07 Github (dkahle/ggmap@c6b7579)
## ggplot2 * 2.2.1 2016-12-30 CRAN (R 3.3.2)
## ggrepel * 0.6.5 2016-11-24 CRAN (R 3.3.2)
## ggstance * 0.3 2016-11-16 CRAN (R 3.3.2)
## gridExtra * 2.2.1 2016-02-29 cran (@2.2.1)
## gtable 0.2.0 2016-02-26 CRAN (R 3.3.0)
## haven * 1.0.0 2016-09-23 cran (@1.0.0)
## here * 0.0-6 2017-02-04 Github (krlmlr/here@007bfd9)
## hexbin * 1.27.1 2015-08-19 CRAN (R 3.3.0)
## highr 0.6 2016-05-09 CRAN (R 3.3.0)
## hms 0.3 2016-11-22 CRAN (R 3.3.2)
## htmltools 0.3.5 2016-03-21 CRAN (R 3.3.0)
## htmlwidgets 0.8 2016-11-09 CRAN (R 3.3.1)
## httpuv 1.3.3 2015-08-04 CRAN (R 3.3.0)
## httr * 1.2.1 2016-07-03 CRAN (R 3.3.0)
## igraph 1.0.1 2015-06-26 CRAN (R 3.3.0)
## ISLR * 1.0 2013-06-11 CRAN (R 3.3.0)
## iterators 1.0.8 2015-10-13 CRAN (R 3.3.0)
## janeaustenr 0.1.4 2016-10-26 CRAN (R 3.3.0)
## jpeg 0.1-8 2014-01-23 cran (@0.1-8)
## jsonlite * 1.2 2016-12-31 CRAN (R 3.3.2)
## kknn * 1.3.1 2016-03-26 CRAN (R 3.3.0)
## knitr * 1.15.1 2016-11-22 cran (@1.15.1)
## labeling 0.3 2014-08-23 CRAN (R 3.3.0)
## lattice * 0.20-34 2016-09-06 CRAN (R 3.3.2)
## lazyeval 0.2.0 2016-06-12 CRAN (R 3.3.0)
## lme4 1.1-12 2016-04-16 cran (@1.1-12)
## lubridate * 1.6.0 2016-09-13 CRAN (R 3.3.0)
## lvplot * 0.2.0.9000 2017-01-06 Github (hadley/lvplot@8ce61c7)
## magrittr 1.5 2014-11-22 CRAN (R 3.3.0)
## mapproj 1.2-4 2015-08-03 CRAN (R 3.3.0)
## maps * 3.1.1 2016-07-27 cran (@3.1.1)
## MASS 7.3-45 2016-04-21 CRAN (R 3.3.2)
## Matrix 1.2-8 2017-01-20 CRAN (R 3.3.2)
## MatrixModels * 0.4-1 2015-08-22 CRAN (R 3.3.0)
## memoise 1.0.0 2016-01-29 CRAN (R 3.3.0)
## mgcv 1.8-17 2017-02-08 CRAN (R 3.3.2)
## microbenchmark * 1.4-2.1 2015-11-25 CRAN (R 3.3.0)
## mime 0.5 2016-07-07 CRAN (R 3.3.0)
## minqa 1.2.4 2014-10-09 cran (@1.2.4)
## mnormt 1.5-5 2016-10-15 CRAN (R 3.3.0)
## ModelMetrics 1.1.0 2016-08-26 CRAN (R 3.3.0)
## modelr * 0.1.0 2016-08-31 CRAN (R 3.3.0)
## modeltools 0.2-21 2013-09-02 CRAN (R 3.3.0)
## munsell 0.4.3 2016-02-13 CRAN (R 3.3.0)
## nlme 3.1-131 2017-02-06 CRAN (R 3.3.2)
## nloptr 1.0.4 2014-08-04 cran (@1.0.4)
## NLP 0.1-9 2016-02-18 CRAN (R 3.3.0)
## nnet * 7.3-12 2016-02-02 CRAN (R 3.3.2)
## nycflights13 * 0.2.2 2017-01-27 CRAN (R 3.3.2)
## pbkrtest 0.4-6 2016-01-27 CRAN (R 3.3.0)
## plyr 1.8.4 2016-06-08 CRAN (R 3.3.0)
## png 0.1-7 2013-12-03 cran (@0.1-7)
## pROC * 1.9.1 2017-02-05 CRAN (R 3.3.2)
## profvis * 0.3.3 2017-01-14 CRAN (R 3.3.2)
## proto 1.0.0 2016-10-29 CRAN (R 3.3.0)
## psych 1.6.12 2017-01-08 CRAN (R 3.3.2)
## purrr * 0.2.2 2016-06-18 CRAN (R 3.3.0)
## quantreg * 5.29 2016-09-04 CRAN (R 3.3.0)
## R6 2.2.0 2016-10-05 CRAN (R 3.3.0)
## randomForest * 4.6-12 2015-10-07 CRAN (R 3.3.0)
## rcfss * 0.1.4 2017-02-28 local
## Rcpp 0.12.9 2017-01-14 CRAN (R 3.3.2)
## readr * 1.0.0 2016-08-03 CRAN (R 3.3.0)
## readxl * 0.1.1 2016-03-28 CRAN (R 3.3.0)
## rebird * 0.3.0 2016-03-23 CRAN (R 3.3.0)
## reshape2 1.4.2 2016-10-22 CRAN (R 3.3.0)
## RgoogleMaps 1.4.1 2016-09-18 cran (@1.4.1)
## rjson 0.2.15 2014-11-03 cran (@0.2.15)
## rmarkdown 1.3 2016-12-21 CRAN (R 3.3.2)
## rprojroot 1.2 2017-01-16 CRAN (R 3.3.2)
## rsconnect 0.7 2016-12-21 CRAN (R 3.3.2)
## RSQLite * 1.1-2 2017-01-08 CRAN (R 3.3.2)
## rstudioapi 0.6 2016-06-27 CRAN (R 3.3.0)
## rvest * 0.3.2 2016-06-17 CRAN (R 3.3.0)
## scales * 0.4.1 2016-11-09 CRAN (R 3.3.1)
## shiny * 1.0.0 2017-01-12 CRAN (R 3.3.2)
## slam 0.1-40 2016-12-01 CRAN (R 3.3.2)
## SnowballC 0.5.1 2014-08-09 cran (@0.5.1)
## sp 1.2-4 2016-12-22 CRAN (R 3.3.2)
## sparklyr * 0.5.2 2017-02-16 CRAN (R 3.3.2)
## SparseM * 1.74 2016-11-10 CRAN (R 3.3.2)
## stringi 1.1.2 2016-10-01 CRAN (R 3.3.0)
## stringr * 1.1.0 2016-08-19 cran (@1.1.0)
## survival * 2.40-1 2016-10-30 CRAN (R 3.3.0)
## tibble * 1.2 2016-08-26 cran (@1.2)
## tidyr * 0.6.1 2017-01-10 CRAN (R 3.3.2)
## tidytext * 0.1.2 2016-10-28 CRAN (R 3.3.0)
## tidyverse * 1.1.1 2017-01-27 CRAN (R 3.3.2)
## titanic * 0.1.0 2015-08-31 CRAN (R 3.3.0)
## tm 0.6-2 2015-07-03 CRAN (R 3.3.0)
## tokenizers 0.1.4 2016-08-29 CRAN (R 3.3.0)
## topicmodels * 0.2-4 2016-05-23 CRAN (R 3.3.0)
## tree * 1.0-37 2016-01-21 CRAN (R 3.3.0)
## withr 1.0.2 2016-06-20 CRAN (R 3.3.0)
## XML * 3.98-1.5 2016-11-10 CRAN (R 3.3.2)
## xml2 * 1.1.1 2017-01-24 CRAN (R 3.3.2)
## xtable 1.8-2 2016-02-05 CRAN (R 3.3.0)
## yaml 2.1.14 2016-11-12 cran (@2.1.14)</code></pre>
</div>
<p>This work is licensed under the <a href="http://creativecommons.org/licenses/by-nc/4.0/">CC BY-NC 4.0 Creative Commons License</a>.</p>
</div>
</div>
</div>
<script>
// add bootstrap table styles to pandoc tables
function bootstrapStylePandocTables() {
$('tr.header').parent('thead').parent('table').addClass('table table-condensed');
}
$(document).ready(function () {
bootstrapStylePandocTables();
});
</script>
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function () {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
document.getElementsByTagName("head")[0].appendChild(script);
})();
</script>
</body>
</html>