The R Researcher's companion
Preface
Why another book about R?
What this book will teach you (and what it will not)
Outline of the book and how to read it
I Workshop 1: Introduction and basics of R
1
What is R and why should you learn it?
1.1
R, a programming language for data analysis
1.2
Why learn R?
1.3
How to approach learning R
2
R, RStudio, and how to get started
2.1
RStudio and other IDEs
2.1.1
Installing RStudio
3
Basic workflow in R using RStudio
3.1
Running code
3.1.1
Scripts
3.1.2
Commenting in a script
3.1.3
Keeping track of our work and saving scripts
4
Objects, functions, and packages
4.1
Objects
4.2
Functions
4.2.1
Default arugments and named arguments
4.2.2
Function help files
4.3
Data types and classes
4.4
Packages
5
Data frames, tibbles, and matrices
5.1
Accessing elements and columns
II Workshop 2: Data in R
6
Working directory and RStudio projects
6.1
Working directory
6.2
RStudio projects
6.2.1
Changing working directory
7
Introduction to the tidyverse
7.1
Pipes
7.2
The magrittr exposition pipe
8
Importing data
9
Data manipulation
9.1
Filtering data
9.2
Selection
9.3
Mutation
9.3.1
Creating categorical or dummy variables
9.4
Piping it all together
10
Summarazing data, grouping, aggregation, and group manipulation
10.1
Summarizing data
10.1.1
Summarizing across multiple variables
10.2
Grouping data
10.3
Aggregation
10.4
Group manipulation
11
Merging data
III Workshop 3: presenting data
12
Re-shaping data
12.1
Wide data and long data
13
Plotting data in ggplot
14
Presenting results in tables
IV Advanced topics
15
Writing for-loops and functions
15.1
For-loops
15.1.1
Storing the results of a for-loop
15.1.2
Nesting for-loops
15.2
Writing functions
V Workshop assignments
Assignment for workshop 1
Assignment for workshop 2
VI Toolbox for hypothesis tests
Bivatiate tests
15.3
Chi-squared tests
15.4
T-test for the difference in means
15.5
Correlation and correlation tests
VII Youtube videos of the chapters
Video links
15.6
Chapters 1-3
15.7
Chapters 6-11
Published with bookdown
The R Researcher’s companion v. 0.01
Chapter 13
Plotting data in ggplot