Skip to content

Commit

Permalink
Changed "Get Updates" sign-up link from google forms to mailchimp
Browse files Browse the repository at this point in the history
  • Loading branch information
rudeboybert committed Feb 9, 2017
1 parent 5f7abaa commit 5223f11
Show file tree
Hide file tree
Showing 29 changed files with 1,070 additions and 322 deletions.
16 changes: 8 additions & 8 deletions bib/packages.bib
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ @Manual{R-broom
@Manual{R-devtools,
title = {devtools: Tools to Make Developing R Packages Easier},
author = {Hadley Wickham and Winston Chang},
note = {R package version 1.12.0.9000},
url = {https://github.com/hadley/devtools},
year = {2016},
note = {R package version 1.12.0},
url = {https://CRAN.R-project.org/package=devtools},
}
@Manual{R-dplyr,
title = {dplyr: A Grammar of Data Manipulation},
Expand All @@ -37,8 +37,8 @@ @Manual{R-dplyr
@Manual{R-dygraphs,
title = {dygraphs: Interface to 'Dygraphs' Interactive Time Series Charting Library},
author = {Dan Vanderkam and JJ Allaire and Jonathan Owen and Daniel Gromer and Petr Shevtsov and Benoit Thieurmel},
year = {2017},
note = {R package version 1.1.1.4},
year = {2016},
note = {R package version 1.1.1.3},
url = {https://CRAN.R-project.org/package=dygraphs},
}
@Manual{R-fivethirtyeight,
Expand All @@ -53,7 +53,7 @@ @Manual{R-ggplot2
title = {ggplot2: Create Elegant Data Visualisations Using the Grammar of Graphics},
author = {Hadley Wickham and Winston Chang},
year = {2016},
note = {R package version 2.2.1},
note = {R package version 2.2.0},
url = {https://CRAN.R-project.org/package=ggplot2},
}
@Manual{R-ggplot2movies,
Expand Down Expand Up @@ -109,7 +109,7 @@ @Manual{R-nycflights13
title = {nycflights13: Flights that Departed NYC in 2013},
author = {Hadley Wickham},
year = {2016},
note = {R package version 0.2.1},
note = {R package version 0.2.0},
url = {https://CRAN.R-project.org/package=nycflights13},
}
@Manual{R-okcupiddata,
Expand All @@ -131,7 +131,7 @@ @Manual{R-rmarkdown
title = {rmarkdown: Dynamic Documents for R},
author = {JJ Allaire and Joe Cheng and Yihui Xie and Jonathan McPherson and Winston Chang and Jeff Allen and Hadley Wickham and Aron Atkins and Rob Hyndman},
year = {2016},
note = {R package version 1.3},
note = {R package version 1.2},
url = {https://CRAN.R-project.org/package=rmarkdown},
}
@Manual{R-tufte,
Expand All @@ -145,6 +145,6 @@ @Manual{R-webshot
title = {webshot: Take Screenshots of Web Pages},
author = {Winston Chang},
year = {2016},
note = {R package version 0.4.0},
note = {R package version 0.3.2},
url = {https://CRAN.R-project.org/package=webshot},
}
5 changes: 2 additions & 3 deletions docs/10-effective-data-storytelling.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<meta name="author" content="Chester Ismay and Albert Y. Kim">


<meta name="date" content="2017-01-22">
<meta name="date" content="2017-02-09">

<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
Expand Down Expand Up @@ -54,8 +54,7 @@
<script src="libs/dygraphs-1.1.1/dygraph-combined.js"></script>
<script src="libs/moment-2.8.4/moment.js"></script>
<script src="libs/moment-timezone-0.2.5/moment-timezone-with-data.js"></script>
<script src="libs/moment-fquarter-1.0.0/moment-fquarter.min.js"></script>
<script src="libs/dygraphs-binding-1.1.1.4/dygraphs.js"></script>
<script src="libs/dygraphs-binding-1.1.1.3/dygraphs.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),
Expand Down
5 changes: 2 additions & 3 deletions docs/2-intro.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<meta name="author" content="Chester Ismay and Albert Y. Kim">


<meta name="date" content="2017-01-22">
<meta name="date" content="2017-02-09">

<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
Expand Down Expand Up @@ -54,8 +54,7 @@
<script src="libs/dygraphs-1.1.1/dygraph-combined.js"></script>
<script src="libs/moment-2.8.4/moment.js"></script>
<script src="libs/moment-timezone-0.2.5/moment-timezone-with-data.js"></script>
<script src="libs/moment-fquarter-1.0.0/moment-fquarter.min.js"></script>
<script src="libs/dygraphs-binding-1.1.1.4/dygraphs.js"></script>
<script src="libs/dygraphs-binding-1.1.1.3/dygraphs.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),
Expand Down
91 changes: 52 additions & 39 deletions docs/3-tidy.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<meta name="author" content="Chester Ismay and Albert Y. Kim">


<meta name="date" content="2017-01-22">
<meta name="date" content="2017-02-09">

<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
Expand Down Expand Up @@ -54,8 +54,7 @@
<script src="libs/dygraphs-1.1.1/dygraph-combined.js"></script>
<script src="libs/moment-2.8.4/moment.js"></script>
<script src="libs/moment-timezone-0.2.5/moment-timezone-with-data.js"></script>
<script src="libs/moment-fquarter-1.0.0/moment-fquarter.min.js"></script>
<script src="libs/dygraphs-binding-1.1.1.4/dygraphs.js"></script>
<script src="libs/dygraphs-binding-1.1.1.3/dygraphs.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),
Expand Down Expand Up @@ -405,6 +404,14 @@ <h3>Needed packages</h3>
<p>At the beginning of this and all subsequent chapters, we’ll always have a list of packages you should have installed and loaded. In particular we load the <code>nycflights13</code> package which we’ll discuss shortly and the <code>dplyr</code> package for data manipulation, the subject of Chapter <a href="5-manip.html#manip">5</a>.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">library</span>(nycflights13)
<span class="kw">library</span>(dplyr)</code></pre></div>
<pre><code>##
## Attaching package: &#39;dplyr&#39;</code></pre>
<pre><code>## The following objects are masked from &#39;package:stats&#39;:
##
## filter, lag</code></pre>
<pre><code>## The following objects are masked from &#39;package:base&#39;:
##
## intersect, setdiff, setequal, union</code></pre>
<!--Subsection on Tidy Data -->
</div>
<div id="what-is-tidy-data" class="section level2">
Expand Down Expand Up @@ -463,33 +470,33 @@ <h2><span class="header-section-number">3.1</span> What is tidy data?</h2>
<tbody>
<tr class="odd">
<td align="left">2009-01-01</td>
<td align="right">-1.382</td>
<td align="right">1.190</td>
<td align="right">-1.954</td>
<td align="right">-0.431</td>
<td align="right">-1.670</td>
<td align="right">-5.342</td>
</tr>
<tr class="even">
<td align="left">2009-01-02</td>
<td align="right">0.124</td>
<td align="right">0.412</td>
<td align="right">-0.718</td>
<td align="right">-1.302</td>
<td align="right">0.636</td>
<td align="right">4.286</td>
</tr>
<tr class="odd">
<td align="left">2009-01-03</td>
<td align="right">0.889</td>
<td align="right">2.994</td>
<td align="right">-3.509</td>
<td align="right">-1.053</td>
<td align="right">1.197</td>
<td align="right">6.420</td>
</tr>
<tr class="even">
<td align="left">2009-01-04</td>
<td align="right">0.455</td>
<td align="right">-0.200</td>
<td align="right">2.269</td>
<td align="right">-0.452</td>
<td align="right">2.654</td>
<td align="right">-2.260</td>
</tr>
<tr class="odd">
<td align="left">2009-01-05</td>
<td align="right">-1.032</td>
<td align="right">1.445</td>
<td align="right">5.089</td>
<td align="right">-0.146</td>
<td align="right">0.280</td>
<td align="right">-6.077</td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -529,7 +536,7 @@ <h2><span class="header-section-number">3.2</span> Datasets in the <code>nycflig
<p>Note that if you look in the leftmost column of the <code>View(flights)</code> output, you will see a column of numbers. These are the row numbers of the dataset. If you glance across a row with the same number, say row 5, you can get an idea of what each row corresponds to. In other words, this will allow you to identify what object is being referred to in a given row. This is often called the <strong>observational unit</strong>. The <strong>observational unit</strong> in this example is an individual flight departing New York City in 2013. You can identify the observational unit by determining what the <strong>thing</strong> is that is being measured in each of the variables.</p>
<p><strong>Note</strong>: Frequently the first thing you should do when given a dataset is to</p>
<ul>
<li>identify the observation unit,</li>
<li>identify the observational unit,</li>
<li>specify the variables, and</li>
<li>give the types of variables you are presented with.</li>
</ul>
Expand Down Expand Up @@ -624,7 +631,7 @@ <h2><span class="header-section-number">3.3</span> How is <code>flights</code> t
<strong><em>Learning check</em></strong>
</p>
</div>
<p><strong>(LC3.8)</strong> Run the following block of code in R to load and view each of the four data frames in the <code>nycflights13</code> package. Switch between the different tabs that have opened to view each of the four data frames. Describe in two sentences for each data frame what stands out to you and what the most important features are of each.</p>
<p><strong>(LC3.8)</strong> Run the following block of code in RStudio to load and view each of the four data frames in the <code>nycflights13</code> package. Switch between the different tabs that have opened to view each of the four data frames. Describe in two sentences for each data frame what stands out to you and what the most important features are of each.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">data</span>(weather)
<span class="kw">data</span>(planes)
<span class="kw">data</span>(airports)
Expand All @@ -638,16 +645,15 @@ <h2><span class="header-section-number">3.3</span> How is <code>flights</code> t
<h3><span class="header-section-number">3.3.1</span> Identification variables</h3>
<p>There is a subtle difference between the kinds of variables that you will encounter in data frames. The <code>airports</code> data frame you worked with above contains data in these different kinds. Let’s pull them apart using the <code>glimpse</code> function:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">glimpse</span>(airports)</code></pre></div>
<pre><code>## Observations: 1,458
## Variables: 8
## $ faa &lt;chr&gt; &quot;04G&quot;, &quot;06A&quot;, &quot;06C&quot;, &quot;06N&quot;, &quot;09J&quot;, &quot;0A9&quot;, &quot;0G6&quot;, &quot;0G7...
## $ name &lt;chr&gt; &quot;Lansdowne Airport&quot;, &quot;Moton Field Municipal Airport&quot;,...
## $ lat &lt;dbl&gt; 41.13, 32.46, 41.99, 41.43, 31.07, 36.37, 41.47, 42.8...
## $ lon &lt;dbl&gt; -80.62, -85.68, -88.10, -74.39, -81.43, -82.17, -84.5...
## $ alt &lt;int&gt; 1044, 264, 801, 523, 11, 1593, 730, 492, 1000, 108, 4...
## $ tz &lt;dbl&gt; -5, -6, -6, -5, -5, -5, -5, -5, -5, -8, -5, -6, -5, -...
## $ dst &lt;chr&gt; &quot;A&quot;, &quot;A&quot;, &quot;A&quot;, &quot;A&quot;, &quot;A&quot;, &quot;A&quot;, &quot;A&quot;, &quot;A&quot;, &quot;U&quot;, &quot;A&quot;, &quot;A&quot;...
## $ tzone &lt;chr&gt; &quot;America/New_York&quot;, &quot;America/Chicago&quot;, &quot;America/Chica...</code></pre>
<pre><code>## Observations: 1,396
## Variables: 7
## $ faa &lt;chr&gt; &quot;04G&quot;, &quot;06A&quot;, &quot;06C&quot;, &quot;06N&quot;, &quot;09J&quot;, &quot;0A9&quot;, &quot;0G6&quot;, &quot;0G7&quot;...
## $ name &lt;chr&gt; &quot;Lansdowne Airport&quot;, &quot;Moton Field Municipal Airport&quot;, ...
## $ lat &lt;dbl&gt; 41.13047, 32.46057, 41.98934, 41.43191, 31.07447, 36.3...
## $ lon &lt;dbl&gt; -80.61958, -85.68003, -88.10124, -74.39156, -81.42778,...
## $ alt &lt;int&gt; 1044, 264, 801, 523, 11, 1593, 730, 492, 1000, 108, 40...
## $ tz &lt;dbl&gt; -5, -5, -6, -5, -4, -4, -5, -5, -5, -8, -5, -6, -5, -4...
## $ dst &lt;chr&gt; &quot;A&quot;, &quot;A&quot;, &quot;A&quot;, &quot;A&quot;, &quot;A&quot;, &quot;A&quot;, &quot;A&quot;, &quot;A&quot;, &quot;U&quot;, &quot;A&quot;, &quot;A&quot;,...</code></pre>
<p>The variables <code>faa</code> and <code>name</code> are what we will call <em>identification variables</em>. They are mainly used to provide a name to the observational unit. Here the observational unit is an airport and the <code>faa</code> gives the code provided by the FAA for that airport while the <code>name</code> variable gives the longer more natural name of the airport. These ID variables differ from the other variables that are often called <em>measurement</em> or <em>characteristic</em> variables. The remaining variables (aside from <code>faa</code> and <code>name</code>) are of this type in <code>airports</code>. They don’t uniquely identify the observational unit, but instead describe properties of the observational unit. For organizational purposes, it is best practice to have your identification variables in the far leftmost columns of your data frame.</p>
<hr />
<div class="learncheck">
Expand All @@ -670,15 +676,14 @@ <h2><span class="header-section-number">3.4</span> Normal forms of data</h2>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">View</span>(joined_flights)</code></pre></div>
<p>If we <code>View</code> this dataset, we see a new variable has been created called <code>name</code>. (We will see in Subsection <a href="5-manip.html#rename">5.4.2</a> ways to change <code>name</code> to a more descriptive variable name.) More discussion about joining data frames together will be given in Chapter <a href="5-manip.html#manip">5</a>. We will see there that the names of the columns to be linked need not match as they did here with <code>&quot;carrier&quot;</code>.</p>
<hr />
<hr />
<div class="review">
<div class="learncheck">
<p>
<strong><em>Review questions</em></strong>
<strong><em>Learning check</em></strong>
</p>
</div>
<p><strong>(RQ3.1)</strong> What are common characteristics of “tidy” datasets?</p>
<p><strong>(RQ3.2)</strong> What makes “tidy” datasets useful for organizing data?</p>
<p><strong>(RQ3.3)</strong> How many variables are presented in the table below? What does each row correspond to? (<strong>Hint:</strong> You may not be able to answer both of these questions immediately but take your best guess.)</p>
<p><strong>(LC3.11)</strong> What are common characteristics of “tidy” datasets?</p>
<p><strong>(LC3.12)</strong> What makes “tidy” datasets useful for organizing data?</p>
<p><strong>(LC3.13)</strong> How many variables are presented in the table below? What does each row correspond to? (<strong>Hint:</strong> You may not be able to answer both of these questions immediately but take your best guess.)</p>
<table>
<thead>
<tr class="header">
Expand All @@ -697,8 +702,8 @@ <h2><span class="header-section-number">3.4</span> Normal forms of data</h2>
</tr>
</tbody>
</table>
<p><strong>(RQ3.4)</strong> The confusion you may have encountered in Question 4 is a common one those that work with data are commonly presented with. This dataset is not tidy. Actually, the dataset in Question 4 has three variables not the two that were presented. Make a guess as to what these variables are and present a tidy dataset instead of this untidy one given in Question 4.</p>
<p><strong>(RQ3.5)</strong> The actual data presented in Question 4 is given below in tidy data format:</p>
<p><strong>(LC3.14)</strong> The confusion you may have encountered in Question 3 is a common one those that work with data are commonly presented with. This dataset is not tidy. Actually, the dataset in Question 4 has three variables not the two that were presented. Make a guess as to what these variables are and present a tidy dataset instead of this untidy one given in Question 4.</p>
<p><strong>(LC3.15)</strong> The actual data presented in Question 4 is given below in tidy data format:</p>
<table>
<thead>
<tr class="header">
Expand Down Expand Up @@ -792,7 +797,15 @@ <h2><span class="header-section-number">3.4</span> Normal forms of data</h2>
</li>
<li>The <code>Sociology?</code> variable is known as a logical variable. What types of values does a logical variable take on?</li>
</ul>
<p><strong>(RQ3.6)</strong> What are some advantages of data in normal forms? What are some disadvantages?</p>
<p><strong>(LC3.16)</strong> What are some advantages of data in normal forms? What are some disadvantages?</p>
<hr />
<hr />
<div class="review">
<p>
<strong><em>Review questions</em></strong>
</p>
</div>
<p><strong>(RQ3.1)</strong></p>
<hr />
<hr />
</div>
Expand Down
Empty file added docs/3-viz.html
Empty file.
Empty file added docs/4-manip.html
Empty file.
7 changes: 3 additions & 4 deletions docs/4-viz.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<meta name="author" content="Chester Ismay and Albert Y. Kim">


<meta name="date" content="2017-01-22">
<meta name="date" content="2017-02-09">

<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
Expand Down Expand Up @@ -54,8 +54,7 @@
<script src="libs/dygraphs-1.1.1/dygraph-combined.js"></script>
<script src="libs/moment-2.8.4/moment.js"></script>
<script src="libs/moment-timezone-0.2.5/moment-timezone-with-data.js"></script>
<script src="libs/moment-fquarter-1.0.0/moment-fquarter.min.js"></script>
<script src="libs/dygraphs-binding-1.1.1.4/dygraphs.js"></script>
<script src="libs/dygraphs-binding-1.1.1.3/dygraphs.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),
Expand Down Expand Up @@ -1159,7 +1158,7 @@ <h2><span class="header-section-number">4.9</span> Conclusion</h2>
<h3><span class="header-section-number">4.9.1</span> Resources</h3>
<p>An excellent resource as you begin to create plots using the <code>ggplot2</code> package is a cheatsheet that RStudio has put together entitled “Data Visualization with ggplot2” available</p>
<ul>
<li>by clicking <a href="https://www.rstudio.com/wp-content/uploads/2015/12/ggplot2-cheatsheet-2.0.pdf">here</a> or</li>
<li>by clicking <a href="https://www.rstudio.com/wp-content/uploads/2016/11/ggplot2-cheatsheet-2.1.pdf">here</a> or</li>
<li>by clicking the RStudio Menu Bar -&gt; Help -&gt; Cheatsheets -&gt; “Data Visualization with <code>ggplot2</code></li>
</ul>
<p>This covers more than what we’ve discussed in this chapter but provides nice visual descriptions of what each function produces.</p>
Expand Down
Empty file added docs/5-hypo.html
Empty file.
Loading

0 comments on commit 5223f11

Please sign in to comment.