Suvival Guide
Preface
1
How to use this guide
1.1
Download the data
1.2
Following along
1.3
Error messages
1.3.1
Function not found
1.3.2
Object not found
2
Getting Started with R and RStudio
2.1
Installing the software
2.2
The RStudio Interface
2.2.1
Learning and experimenting in the console
2.2.2
Writing R scripts in the source pane
2.2.3
The other panes
2.3
Writing R scripts
2.3.1
Commenting with #
2.3.2
Saving your R Script
2.4
R Packages
2.4.1
Installing packages
2.4.2
Loading packages for use
2.5
Setting a directory
2.6
Getting help with R
3
Basics of R Programming
3.1
Thinking like R
3.2
Objects
3.3
Functions in R
3.4
The Pipe Operator
4
Working with data
4.1
Importing data
4.1.1
R data (.rdata)
4.1.2
Delimited (.csv) files
4.1.3
Excel (.xls, .xlsx) files
4.1.4
Stata (.dta) or SPSS (.sav) files
4.2
A first look at your data
4.3
Referencing variables of a data frame
4.4
Saving your work
4.4.1
Saving an R script
4.4.2
Saving a data frame
5
Describing continuous variables
5.1
Describing one variable
5.1.1
Summary statistics
5.1.2
Graphing the distribution
5.2
Omitting missing values
5.3
Group comparisons
5.3.1
Summary statistics by group
5.3.2
Visualize group differences
6
Describing categorical variables
6.1
Describing one variable
6.2
Cross-tabulation
6.3
Means of binary variables
7
Regression analysis
7.1
Correlation
7.2
OLS regression
7.3
Scatter with linear fit
7.4
Logistic regression
7.5
Making regression tables
8
Doing more with data frames
8.1
Filter/subset data
8.2
Selecting your variables
8.3
Create new variables
8.4
Appending and merging data
8.4.1
Appending new observations
8.4.2
Merging
9
Visualization with
ggplot()
9.1
Describe one variable
9.2
Visualizing relationships
9.3
Professional formatting
9.3.1
Titles and labels
9.3.2
Axis options
9.3.3
Legend options
9.4
Exporting/saving graphs
Published with bookdown
Survival Guide: Conquering R and living through SIS 600
Chapter 3
Basics of R Programming