Preface |
|
vii | |
Why Should You Learn R Too? |
|
vii | |
Who Should Read This Book? What Does This Book Hope to Achieve? |
|
vii | |
What Is in This Book? How Can You Use It? |
|
viii | |
What Is Unique About This Book? |
|
ix | |
Acknowledgments |
|
xi | |
About the Authors |
|
xiii | |
|
Chapter 1 Making Preparations: Software Installation and Project Setup |
|
|
1 | (10) |
|
|
1 | (1) |
|
1.2 How to Download and Install R for Windows |
|
|
1 | (2) |
|
1.3 How to Download and Install R for Mac |
|
|
3 | (1) |
|
1.4 Downloading and Installing RStudio |
|
|
4 | (1) |
|
1.5 Setting Up a Project in RStudio |
|
|
5 | (3) |
|
1.6 Creating Folders Under a Project |
|
|
8 | (1) |
|
|
9 | (1) |
|
|
10 | (1) |
|
Chapter 2 Writing Your Essay Using R Markdown: Something for Everyone |
|
|
11 | (22) |
|
|
11 | (1) |
|
2.2 The Pros of Using R Markdown |
|
|
12 | (1) |
|
2.3 How to Create an R Markdown File |
|
|
12 | (3) |
|
2.4 How to Write and Format Text in R Markdown |
|
|
15 | (1) |
|
2.5 A Simple Example of an R Markdown Document |
|
|
16 | (2) |
|
2.6 Other Useful Formatting Tricks |
|
|
18 | (2) |
|
2.7 How to Use R Markdown for a Writing Assignment: A Bare-Bones Example |
|
|
20 | (4) |
|
2.8 How to Revise and Improve Your Bare-Bones Essay |
|
|
24 | (3) |
|
2.9 For More Ambitious Readers |
|
|
27 | (2) |
|
2.10 Exercise: Turning Knowledge Into Results |
|
|
29 | (1) |
|
|
30 | (1) |
|
|
31 | (2) |
|
Chapter 3 Creating Data and Graphs in Your Essays |
|
|
33 | (26) |
|
|
33 | (2) |
|
3.2 Bar Plot I: Graphing the Winners of a Hot Dog Eating Contest |
|
|
35 | (4) |
|
3.3 Bar Plot II: Graphing Winning Lottery Numbers in Texas Pick-3 |
|
|
39 | (3) |
|
3.4 Pie Chart: Graphing the Composition of Daily Plays Among Top 5 Songs on Spotify |
|
|
42 | (3) |
|
3.5 Histogram: Graphing the Distribution of LSAT Scores in a Review Class |
|
|
45 | (3) |
|
3.6 Scatter Plot: Graphing the Relationship Between Two Variables--Gas Mileages in the City and on the Highway |
|
|
48 | (4) |
|
3.7 Time Series Plot: Graphing the Changing Pattern of YouTube Video Views |
|
|
52 | (4) |
|
3.8 Useful Tips: Polishing and Exporting Graphs |
|
|
56 | (1) |
|
|
57 | (1) |
|
|
58 | (1) |
|
Chapter 4 Preparing Your Data |
|
|
59 | (24) |
|
|
59 | (2) |
|
4.2 Writing and Running a Program in R |
|
|
61 | (2) |
|
4.3 Creating Variables and Forming a Dataset |
|
|
63 | (1) |
|
4.4 Manipulating Data Using the dplyr Package |
|
|
64 | (11) |
|
4.5 Chaining Different Data Manipulation Operations: pipe (% > %) |
|
|
75 | (2) |
|
4.6 Missing Values in R: NA |
|
|
77 | (3) |
|
|
80 | (1) |
|
|
81 | (2) |
|
Chapter 5 Accessing Datasets |
|
|
83 | (34) |
|
|
83 | (1) |
|
5.2 Setting Up an RStudio Project |
|
|
84 | (1) |
|
5.3 Downloading a Dataset |
|
|
85 | (1) |
|
5.4 Installing R Packages for Data Importing |
|
|
86 | (1) |
|
5.5 Importing a Downloaded Dataset in RStudio |
|
|
86 | (9) |
|
5.6 Using R Data Packages: A Simple Example With gapminder |
|
|
95 | (4) |
|
5.7 Using R Data Packages: A More Advanced Example With wbstats |
|
|
99 | (11) |
|
5.8 Using R Data Packages: Finding More R Data Packages |
|
|
110 | (4) |
|
5.9 Where Can You Find More Data? |
|
|
114 | (1) |
|
|
114 | (1) |
|
|
115 | (2) |
|
Chapter 6 Exploratory Data Analysis: Three Exercises |
|
|
117 | (46) |
|
|
117 | (1) |
|
6.2 Exercise 1: Reporting Results of the 2016 Presidential Primary in King County, Washington |
|
|
118 | (9) |
|
6.3 Exercise 2: Human Use of Natural Resources: Consumption and Biocapacity |
|
|
127 | (11) |
|
6.4 Exercise 3: Exploring the Impact of GDP per Capita on Life Expectancy |
|
|
138 | (20) |
|
|
158 | (2) |
|
|
160 | (3) |
|
Chapter 7 Writing Your Research Paper Using R: Analyzing the Effect of Economic Development on Life Expectancy |
|
|
163 | |