Skip to content

Commit

Permalink
v0.3.0 is a go!
Browse files Browse the repository at this point in the history
  • Loading branch information
rudeboybert committed Feb 3, 2018
1 parent 9cb75a4 commit 8401906
Show file tree
Hide file tree
Showing 356 changed files with 245 additions and 7,456 deletions.
37 changes: 18 additions & 19 deletions bib/packages.bib
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ @Manual{R-base
@Manual{R-bookdown,
title = {bookdown: Authoring Books and Technical Documents with R Markdown},
author = {Yihui Xie},
year = {2018},
note = {R package version 0.6},
year = {2017},
note = {R package version 0.5},
url = {https://CRAN.R-project.org/package=bookdown},
}
@Manual{R-devtools,
title = {devtools: Tools to Make Developing R Packages Easier},
author = {Hadley Wickham and Winston Chang},
year = {2017},
note = {R package version 1.13.4},
note = {R package version 1.13.2},
url = {https://CRAN.R-project.org/package=devtools},
}
@Manual{R-dplyr,
Expand All @@ -35,18 +35,17 @@ @Manual{R-dygraphs
url = {https://CRAN.R-project.org/package=dygraphs},
}
@Manual{R-fivethirtyeight,
title = {fivethirtyeight: Data and Code Behind the Stories and Interactives at
'FiveThirtyEight'},
author = {Chester Ismay and Jennifer Chunn},
title = {fivethirtyeight: Data and Code Behind the Stories and Interactives at 'FiveThirtyEight'},
author = {Albert Y. Kim and Chester Ismay and Jennifer Chunn},
note = {R package version 0.3.0.9000},
url = {https://github.com/rudeboybert/fivethirtyeight},
year = {2017},
note = {R package version 0.3.0},
url = {https://CRAN.R-project.org/package=fivethirtyeight},
}
@Manual{R-ggplot2,
title = {ggplot2: Create Elegant Data Visualisations Using the Grammar of Graphics},
author = {Hadley Wickham and Winston Chang},
note = {http://ggplot2.tidyverse.org, https://github.com/tidyverse/ggplot2},
year = {2018},
year = {2017},
}
@Manual{R-ggplot2movies,
title = {ggplot2movies: Movies Data},
Expand All @@ -58,15 +57,15 @@ @Manual{R-ggplot2movies
@Manual{R-knitr,
title = {knitr: A General-Purpose Package for Dynamic Report Generation in R},
author = {Yihui Xie},
year = {2018},
note = {R package version 1.19},
year = {2017},
note = {R package version 1.18},
url = {https://CRAN.R-project.org/package=knitr},
}
@Manual{R-mosaic,
title = {mosaic: Project MOSAIC Statistics and Mathematics Teaching Utilities},
author = {Randall Pruim and Daniel T. Kaplan and Nicholas J. Horton},
year = {2017},
note = {R package version 1.1.1},
note = {R package version 1.0.0},
url = {https://CRAN.R-project.org/package=mosaic},
}
@Manual{R-nycflights13,
Expand Down Expand Up @@ -101,28 +100,28 @@ @Manual{R-rmarkdown
@Manual{R-tibble,
title = {tibble: Simple Data Frames},
author = {Kirill Müller and Hadley Wickham},
year = {2018},
note = {R package version 1.4.2},
year = {2017},
note = {R package version 1.3.4},
url = {https://CRAN.R-project.org/package=tibble},
}
@Manual{R-tidyr,
title = {tidyr: Easily Tidy Data with 'spread()' and 'gather()' Functions},
author = {Hadley Wickham and Lionel Henry},
year = {2018},
note = {R package version 0.8.0},
year = {2017},
note = {R package version 0.7.2},
url = {https://CRAN.R-project.org/package=tidyr},
}
@Manual{R-tufte,
title = {tufte: Tufte's Styles for R Markdown Documents},
author = {Yihui Xie and JJ Allaire},
year = {2018},
note = {R package version 0.3},
year = {2016},
note = {R package version 0.2},
url = {https://CRAN.R-project.org/package=tufte},
}
@Manual{R-webshot,
title = {webshot: Take Screenshots of Web Pages},
author = {Winston Chang},
year = {2017},
note = {R package version 0.5.0},
note = {R package version 0.4.1},
url = {https://CRAN.R-project.org/package=webshot},
}
56 changes: 27 additions & 29 deletions docs/10-hypo.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>An Introduction to Statistical and Data Sciences via R</title>
<meta name="description" content="An open-source and fully-reproducible electronic textbook bridging the gap between traditional introductory statistics and data science courses.">
<meta name="generator" content="bookdown 0.6 and GitBook 2.6.7">
<meta name="generator" content="bookdown 0.5 and GitBook 2.6.7">

<meta property="og:title" content="An Introduction to Statistical and Data Sciences via R" />
<meta property="og:type" content="book" />
Expand Down Expand Up @@ -46,7 +46,7 @@



<script src="libs/htmlwidgets-1.0/htmlwidgets.js"></script>
<script src="libs/htmlwidgets-0.9/htmlwidgets.js"></script>
<link href="libs/dygraphs-1.1.1/dygraph.css" rel="stylesheet" />
<script src="libs/dygraphs-1.1.1/dygraph-combined.js"></script>
<script src="libs/moment-2.8.4/moment.js"></script>
Expand Down Expand Up @@ -933,18 +933,18 @@ <h3><span class="header-section-number">10.9.2</span> Comparing action and roman
<p>The <code>movies</code> dataset in the <code>ggplot2movies</code> package contains information on a large number of movies that have been rated by users of IMDB.com <span class="citation">(Wickham 2015)</span>. We are interested in the question here of whether <code>Action</code> movies are rated higher on IMDB than <code>Romance</code> movies. We will first need to do a little bit of data wrangling using the ideas from Chapter <a href="5-wrangling.html#wrangling">5</a> to get the data in the form that we would like:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">(movies_trimmed &lt;-<span class="st"> </span>movies <span class="op">%&gt;%</span><span class="st"> </span><span class="kw">select</span>(title, year, rating, Action, Romance))</code></pre></div>
<pre><code># A tibble: 58,788 x 5
title year rating Action Romance
&lt;chr&gt; &lt;int&gt; &lt;dbl&gt; &lt;int&gt; &lt;int&gt;
1 $ 1971 6.40 0 0
2 $1000 a Touchdown 1939 6.00 0 0
3 $21 a Day Once a Month 1941 8.20 0 0
4 $40,000 1996 8.20 0 0
5 $50,000 Climax Show, The 1975 3.40 0 0
6 $pent 2000 4.30 0 0
7 $windle 2002 5.30 1 0
8 &#39;15&#39; 2002 6.70 0 0
9 &#39;38 1987 6.60 0 0
10 &#39;49-&#39;17 1917 6.00 0 0
title year rating Action Romance
&lt;chr&gt; &lt;int&gt; &lt;dbl&gt; &lt;int&gt; &lt;int&gt;
1 $ 1971 6.4 0 0
2 $1000 a Touchdown 1939 6.0 0 0
3 $21 a Day Once a Month 1941 8.2 0 0
4 $40,000 1996 8.2 0 0
5 $50,000 Climax Show, The 1975 3.4 0 0
6 $pent 2000 4.3 0 0
7 $windle 2002 5.3 1 0
8 &#39;15&#39; 2002 6.7 0 0
9 &#39;38 1987 6.6 0 0
10 &#39;49-&#39;17 1917 6.0 0 0
# ... with 58,778 more rows</code></pre>
<p>Note that <code>Action</code> and <code>Romance</code> are binary variables here. To remove any overlap of movies (and potential confusion) that are both <code>Action</code> and <code>Romance</code>, we will remove them from our <em>population</em>:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">movies_trimmed &lt;-<span class="st"> </span>movies_trimmed <span class="op">%&gt;%</span>
Expand Down Expand Up @@ -1151,16 +1151,16 @@ <h3><span class="header-section-number">10.9.9</span> Distribution of <span clas
<pre><code># A tibble: 10 x 2
.index diffmean
&lt;dbl&gt; &lt;dbl&gt;
1 1.00 -0.132
2 2.00 -0.197
3 3.00 -0.0265
4 4.00 0.715
5 5.00 -0.474
6 6.00 -0.121
7 7.00 -0.174
8 8.00 -0.209
9 9.00 -0.00882
10 10.0 -0.332 </code></pre>
1 1 -0.13235
2 2 -0.19706
3 3 -0.02647
4 4 0.71471
5 5 -0.47353
6 6 -0.12059
7 7 -0.17353
8 8 -0.20882
9 9 -0.00882
10 10 -0.33235</code></pre>
<p>We can now plot the distribution of these simulated differences in means:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">ggplot</span>(<span class="dt">data =</span> rand_distn, <span class="kw">aes</span>(<span class="dt">x =</span> diffmean)) <span class="op">+</span>
<span class="st"> </span><span class="kw">geom_histogram</span>(<span class="dt">color =</span> <span class="st">&quot;white&quot;</span>, <span class="dt">bins =</span> <span class="dv">20</span>)</code></pre></div>
Expand Down Expand Up @@ -1647,11 +1647,9 @@ <h3><span class="header-section-number">10.13.2</span> Script of R code</h3>
(function () {
var script = document.createElement("script");
script.type = "text/javascript";
var src = "";
if (src === "" || src === "true") src = "https://cdn.bootcss.com/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML";
if (location.protocol !== "file:" && /^https?:/.test(src))
src = src.replace(/^https?:/, '');
script.src = src;
script.src = "https://cdn.bootcss.com/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML";
if (location.protocol !== "file:" && /^https?:/.test(script.src))
script.src = script.src.replace(/^https?:/, '');
document.getElementsByTagName("head")[0].appendChild(script);
})();
</script>
Expand Down
12 changes: 5 additions & 7 deletions docs/11-inference-for-regression.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>An Introduction to Statistical and Data Sciences via R</title>
<meta name="description" content="An open-source and fully-reproducible electronic textbook bridging the gap between traditional introductory statistics and data science courses.">
<meta name="generator" content="bookdown 0.6 and GitBook 2.6.7">
<meta name="generator" content="bookdown 0.5 and GitBook 2.6.7">

<meta property="og:title" content="An Introduction to Statistical and Data Sciences via R" />
<meta property="og:type" content="book" />
Expand Down Expand Up @@ -46,7 +46,7 @@



<script src="libs/htmlwidgets-1.0/htmlwidgets.js"></script>
<script src="libs/htmlwidgets-0.9/htmlwidgets.js"></script>
<link href="libs/dygraphs-1.1.1/dygraph.css" rel="stylesheet" />
<script src="libs/dygraphs-1.1.1/dygraph-combined.js"></script>
<script src="libs/moment-2.8.4/moment.js"></script>
Expand Down Expand Up @@ -690,11 +690,9 @@ <h3><span class="header-section-number">11.1.3</span> Script of R code</h3>
(function () {
var script = document.createElement("script");
script.type = "text/javascript";
var src = "";
if (src === "" || src === "true") src = "https://cdn.bootcss.com/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML";
if (location.protocol !== "file:" && /^https?:/.test(src))
src = src.replace(/^https?:/, '');
script.src = src;
script.src = "https://cdn.bootcss.com/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML";
if (location.protocol !== "file:" && /^https?:/.test(script.src))
script.src = script.src.replace(/^https?:/, '');
document.getElementsByTagName("head")[0].appendChild(script);
})();
</script>
Expand Down
14 changes: 6 additions & 8 deletions docs/12-thinking-with-data.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>An Introduction to Statistical and Data Sciences via R</title>
<meta name="description" content="An open-source and fully-reproducible electronic textbook bridging the gap between traditional introductory statistics and data science courses.">
<meta name="generator" content="bookdown 0.6 and GitBook 2.6.7">
<meta name="generator" content="bookdown 0.5 and GitBook 2.6.7">

<meta property="og:title" content="An Introduction to Statistical and Data Sciences via R" />
<meta property="og:type" content="book" />
Expand Down Expand Up @@ -46,7 +46,7 @@



<script src="libs/htmlwidgets-1.0/htmlwidgets.js"></script>
<script src="libs/htmlwidgets-0.9/htmlwidgets.js"></script>
<link href="libs/dygraphs-1.1.1/dygraph.css" rel="stylesheet" />
<script src="libs/dygraphs-1.1.1/dygraph-combined.js"></script>
<script src="libs/moment-2.8.4/moment.js"></script>
Expand Down Expand Up @@ -489,7 +489,7 @@ <h1><span class="header-section-number">12</span> Thinking with Data</h1>
<h2><span class="header-section-number">12.1</span> Effective Data Storytelling</h2>
<p>As we’ve progressed throughout this book, you’ve seen how to work with data in a variety of ways. You’ve learned effective strategies for plotting data by understanding which types of plots work best for which combinations of variable types. You’ve summarized data in table form and calculated summary statistics for a variety of different variables. Further, you’ve seen the value of inference as a process to come to conclusions about a population by using a random sample. Lastly, you’ve explored how to use linear regression and the importance of checking the conditions required to make it a valid procedure. All throughout, you’ve learned many computational techniques and focused on reproducible research in writing R code and keeping track of your work in R Markdown. All of these steps go into making a great story using data.</p>
<p>As the textbook comes to a close, we thought it best that you explore what stellar work is being produced by data journalists throughout the world that specialize in effective data storytelling. We recommend you read and analyze this article by Walt Hickey entitled <a href="http://fivethirtyeight.com/features/the-dollar-and-cents-case-against-hollywoods-exclusion-of-women/">The Dollar-And-Cents Case Against Hollywood’s Exclusion of Women</a>. As you read over it, think carefully about how Walt is using data, graphics, and analyses to paint the picture for the reader of what the story is he wants to tell.</p>
<p>In the spirit of reproducibility, the members of FiveThirtyEight have also shared the data that they used to create this story and some R code <a href="https://github.com/fivethirtyeight/data/tree/master/bechdel">here</a>. A vignette showing how to reproduce one of the plots at the end of the article using <code>dplyr</code>, <code>ggplot2</code>, and other packages in Hadley’s <code>tidyverse</code> is available <a href="https://cran.r-project.org/web/packages/fivethirtyeight/vignettes/bechdel.html">here</a> as part of the <a href="https://rudeboybert.github.io/fivethirtyeight/"><code>fivethirtyeight</code> R package</a> <span class="citation">(Ismay and Chunn 2017)</span>. Great data stories don’t mislead the reader, but rather engulf them in understanding the importance that data plays in our lives through the captivation of storytelling.</p>
<p>In the spirit of reproducibility, the members of FiveThirtyEight have also shared the data that they used to create this story and some R code <a href="https://github.com/fivethirtyeight/data/tree/master/bechdel">here</a>. A vignette showing how to reproduce one of the plots at the end of the article using <code>dplyr</code>, <code>ggplot2</code>, and other packages in Hadley’s <code>tidyverse</code> is available <a href="https://cran.r-project.org/web/packages/fivethirtyeight/vignettes/bechdel.html">here</a> as part of the <a href="https://rudeboybert.github.io/fivethirtyeight/"><code>fivethirtyeight</code> R package</a> <span class="citation">(Kim, Ismay, and Chunn 2017)</span>. Great data stories don’t mislead the reader, but rather engulf them in understanding the importance that data plays in our lives through the captivation of storytelling.</p>
</div>
<div id="examples" class="section level2">
<h2><span class="header-section-number">12.2</span> Examples</h2>
Expand Down Expand Up @@ -555,11 +555,9 @@ <h2>Concluding remarks</h2>
(function () {
var script = document.createElement("script");
script.type = "text/javascript";
var src = "";
if (src === "" || src === "true") src = "https://cdn.bootcss.com/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML";
if (location.protocol !== "file:" && /^https?:/.test(src))
src = src.replace(/^https?:/, '');
script.src = src;
script.src = "https://cdn.bootcss.com/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML";
if (location.protocol !== "file:" && /^https?:/.test(script.src))
script.src = script.src.replace(/^https?:/, '');
document.getElementsByTagName("head")[0].appendChild(script);
})();
</script>
Expand Down
Loading

0 comments on commit 8401906

Please sign in to comment.