|
|
1 | (18) |
|
|
1 | (4) |
|
|
1 | (1) |
|
1.1.2 The business perspective |
|
|
2 | (1) |
|
|
3 | (1) |
|
1.1.4 Our ecology example We love fruit |
|
|
3 | (2) |
|
1.2 Question, question, question (how are data born?) |
|
|
5 | (2) |
|
1.3 But what exactly are data? |
|
|
7 | (1) |
|
1.4 Response and predictor variables |
|
|
8 | (1) |
|
1.5 Some key features of datasets |
|
|
9 | (2) |
|
1.6 Demonstrations of getting insights from data |
|
|
11 | (5) |
|
1.7 The general Insights workflow |
|
|
16 | (1) |
|
1.8 Summing up and looking forward |
|
|
17 | (2) |
|
Chapter 2 Getting acquainted |
|
|
19 | (36) |
|
2.1 Getting acquainted with R and RStudio |
|
|
19 | (7) |
|
|
20 | (1) |
|
|
21 | (1) |
|
2.1.3 Getting and installing R |
|
|
22 | (1) |
|
2.1.4 Getting and installing RStudio |
|
|
23 | (1) |
|
2.1.5 A brief tour of RStudio |
|
|
24 | (2) |
|
2.2 Your first R command! |
|
|
26 | (6) |
|
2.2.1 Getting to know R a little better |
|
|
27 | (2) |
|
2.2.2 Storing and reusing results |
|
|
29 | (2) |
|
2.2.3 What names should I use? |
|
|
31 | (1) |
|
|
32 | (4) |
|
2.3.1 Comments in your scripts |
|
|
34 | (1) |
|
2.3.2 Save and keep safe your script file |
|
|
35 | (1) |
|
2.3.3 Running your scripts |
|
|
36 | (1) |
|
|
36 | (3) |
|
|
37 | (1) |
|
|
38 | (1) |
|
|
38 | (1) |
|
|
39 | (3) |
|
2.5.1 Functions, the sequel |
|
|
41 | (1) |
|
|
42 | (6) |
|
2.6.1 Finding add-on packages |
|
|
43 | (1) |
|
2.6.2 Installing (downloading) packages |
|
|
44 | (2) |
|
|
46 | (1) |
|
|
46 | (1) |
|
2.6.5 Updating R, RStudio, and your packages |
|
|
47 | (1) |
|
|
48 | (4) |
|
2.7.1 R help system and files |
|
|
48 | (1) |
|
2.7.2 Navigating help files |
|
|
49 | (1) |
|
|
50 | (1) |
|
|
50 | (1) |
|
2.7.5 Other sources of help |
|
|
51 | (1) |
|
2.7.6 Asking for help from others |
|
|
51 | (1) |
|
|
52 | (1) |
|
2.9 Summing up and looking forward |
|
|
52 | (3) |
|
Chapter 3 Workflow Demonstration part 1: Preparation |
|
|
55 | (42) |
|
3.1 What is the question? |
|
|
57 | (3) |
|
3.1.1 The three response variables |
|
|
58 | (1) |
|
|
59 | (1) |
|
|
60 | (1) |
|
|
61 | (5) |
|
3.3.1 Acquire the dataset |
|
|
64 | (2) |
|
3.4 Preparing your computer |
|
|
66 | (6) |
|
3.4.1 Making the project folder for the bat data |
|
|
67 | (1) |
|
3.4.2 Projects in RStudio |
|
|
68 | (3) |
|
3.4.3 Create a new R script and load packages |
|
|
71 | (1) |
|
|
72 | (6) |
|
3.5.1 View and refine the import |
|
|
76 | (2) |
|
3.6 Getting going with data management |
|
|
78 | (3) |
|
3.6.1 How the data are stored in R |
|
|
79 | (2) |
|
3.7 Clean and tidy the data |
|
|
81 | (11) |
|
|
82 | (1) |
|
|
82 | (1) |
|
3.7.3 Refine the variable names |
|
|
83 | (2) |
|
|
85 | (1) |
|
3.7.5 Rename some values in a variable |
|
|
86 | (1) |
|
3.7.6 Check for duplicates |
|
|
87 | (2) |
|
3.7.7 Check for implausible and invalid values |
|
|
89 | (1) |
|
3.7.8 What about those NAs? |
|
|
90 | (2) |
|
3.8 Stop that! Don't even think about it! |
|
|
92 | (2) |
|
3.8.1 Don't mess with the `working directory' |
|
|
92 | (1) |
|
3.8.2 Don't use the data import tool or file choose |
|
|
93 | (1) |
|
3.8.3 Don't even think about using the attach function |
|
|
93 | (1) |
|
3.8.4 Avoid using square brackets or dollar signs |
|
|
93 | (1) |
|
3.9 Summing up and looking forward |
|
|
94 | (3) |
|
Chapter 4 Workflow Demonstration part 2: Getting insights |
|
|
97 | (44) |
|
4.1 Initial insights 1: Numbers and counting |
|
|
98 | (5) |
|
4.1.1 Our first insights: The number, sex, and age of bats |
|
|
98 | (5) |
|
4.2 Initial insights 2: Distributions |
|
|
103 | (5) |
|
4.2.1 Insights... you've done it! |
|
|
105 | (3) |
|
|
108 | (3) |
|
4.4 Insights about our questions |
|
|
111 | (14) |
|
4.4.1 Distribution of number of prey |
|
|
111 | (2) |
|
4.4.2 Shapes: Mean wingspan |
|
|
113 | (1) |
|
4.4.3 Shapes: Proportion migratory |
|
|
114 | (2) |
|
|
116 | (5) |
|
4.4.5 Communication (beautifying the graphs) |
|
|
121 | (1) |
|
4.4.6 Beautifying the wingspan, age, sex graph |
|
|
122 | (3) |
|
4.5 Another view of the question and data |
|
|
125 | (12) |
|
4.5.1 Before you continue |
|
|
125 | (1) |
|
4.5.2 A prey-centric view |
|
|
125 | (12) |
|
|
137 | (1) |
|
4.7 Summing up and looking forward |
|
|
138 | (1) |
|
4.8 A small reward, if you like dogs |
|
|
139 | (2) |
|
Chapter 5 Dealing with data 1: Digging into dplyr |
|
|
141 | (28) |
|
|
142 | (13) |
|
5.1.1 Selecting variables with the select function |
|
|
143 | (3) |
|
5.1.2 Renaming variables with select and rename |
|
|
146 | (1) |
|
5.1.3 Creating new variables with the mutate function |
|
|
146 | (3) |
|
5.1.4 Getting particular observations with filter |
|
|
149 | (4) |
|
5.1.5 Ordering observations with arrange |
|
|
153 | (2) |
|
5.2 Grouping and summarizing data with dplyr |
|
|
155 | (12) |
|
5.2.1 Summarizing data--the nitty-gritty |
|
|
156 | (4) |
|
5.2.2 Grouped summaries using group_by magic |
|
|
160 | (3) |
|
5.2.3 More than one grouping variable |
|
|
163 | (2) |
|
5.2.4 Using group_by with other verbs |
|
|
165 | (1) |
|
5.2.5 Removing grouping information |
|
|
166 | (1) |
|
5.3 Summing up and looking forward |
|
|
167 | (2) |
|
Chapter 6 Dealing with data 2: Expanding your toolkit |
|
|
169 | (26) |
|
|
170 | (5) |
|
6.1.1 Why do we need pipes? |
|
|
170 | (4) |
|
6.1.2 On why you shouldn't nest functions |
|
|
174 | (1) |
|
6.2 Subduing the pesky string |
|
|
175 | (3) |
|
6.3 Elegantly managing dates and times |
|
|
178 | (8) |
|
|
178 | (1) |
|
6.3.2 Dates in the bat project data |
|
|
179 | (1) |
|
|
180 | (1) |
|
6.3.4 More about parsing dates/times |
|
|
181 | (2) |
|
6.3.5 Calculations with dates/times |
|
|
183 | (3) |
|
6.4 Changing between wider and longer data arrangements |
|
|
186 | (6) |
|
|
187 | (3) |
|
|
190 | (2) |
|
6.5 Summing up and looking forward |
|
|
192 | (3) |
|
Chapter 7 Getting to grips with ggplot2 |
|
|
195 | (16) |
|
|
196 | (5) |
|
|
197 | (3) |
|
|
200 | (1) |
|
|
200 | (1) |
|
|
201 | (1) |
|
7.2 Putting it into practice |
|
|
201 | (3) |
|
7.2.1 Inheriting data and aesthetics from ggplot |
|
|
202 | (2) |
|
|
204 | (4) |
|
7.3.1 Working with layer-specific geom properties |
|
|
205 | (2) |
|
7.3.2 Adding titles and labels |
|
|
207 | (1) |
|
|
207 | (1) |
|
7.4 Summing up and looking forward |
|
|
208 | (3) |
|
Chapter 8 Making deeper insights part 1: Working with single variables |
|
|
211 | (36) |
|
|
212 | (4) |
|
8.1.1 Numeric versus categorical variables |
|
|
213 | (2) |
|
8.1.2 Ratio versus interval scales |
|
|
215 | (1) |
|
8.2 Samples and distributions |
|
|
216 | (4) |
|
8.2.1 Understanding numerical variables |
|
|
218 | (2) |
|
8.3 Graphical summaries of numeric variables |
|
|
220 | (14) |
|
8.3.1 Making some insights about wingspan |
|
|
222 | (5) |
|
8.3.2 Descriptive statistics for numeric variables |
|
|
227 | (1) |
|
8.3.3 Measuring central tendency |
|
|
228 | (1) |
|
8.3.4 Measuring dispersion |
|
|
229 | (2) |
|
8.3.5 Mapping measures of central tendency and dispersion to a figure |
|
|
231 | (2) |
|
8.3.6 Combining histograms and boxplots |
|
|
233 | (1) |
|
8.4 A moment with missing values in numeric variables (NAs) |
|
|
234 | (2) |
|
8.5 Exploring a categorical variable |
|
|
236 | (8) |
|
8.5.1 Understanding categorical variables |
|
|
236 | (8) |
|
8.6 Summing up and looking forward |
|
|
244 | (1) |
|
|
245 | (2) |
|
Chapter 9 Making deeper insights part 2: Relationships among (many) variables |
|
|
247 | (24) |
|
9.1 Associations between two numeric variables |
|
|
248 | (8) |
|
9.1.1 Descriptive statistics: Correlations |
|
|
248 | (3) |
|
9.1.2 Other measures of correlation |
|
|
251 | (1) |
|
9.1.3 Graphical summaries between two numeric variables: The scatterplot |
|
|
252 | (4) |
|
9.2 Associations between two categorical variables |
|
|
256 | (5) |
|
9.2.1 Numerical summaries |
|
|
256 | (2) |
|
9.2.2 Graphical summaries |
|
|
258 | (2) |
|
9.2.3 An alternative, and perhaps more valuable |
|
|
260 | (1) |
|
9.3 Categorical-numerical associations |
|
|
261 | (6) |
|
9.3.1 Numerical summaries |
|
|
262 | (1) |
|
9.3.2 Graphical summaries for numerical versus categorical data |
|
|
262 | (2) |
|
9.3.3 Alternatives to box-and-whisker plots |
|
|
264 | (3) |
|
9.4 Building in complexity: Relationships among three or more variables |
|
|
267 | (2) |
|
9.5 Summing up and looking forward |
|
|
269 | (2) |
|
Chapter 10 Looking back and looking forward |
|
|
271 | (12) |
|
|
272 | (2) |
|
10.2 Reproducibility: What, why, and how? |
|
|
274 | (7) |
|
10.2.1 Why should you try and make your work reproducible? |
|
|
274 | (1) |
|
10.2.2 How can you make your work more reproducible? |
|
|
275 | (6) |
|
|
281 | (2) |
Index |
|
283 | |