Quantitative skills for biology
1
Overview
1.1
Course links
1.2
Instructor guide
1.3
R help center
PART I: INTRODUCTION
2
R and R Studio
2.1
Installing R and RStudio
2.1.1
RStudio Cloud
2.2
Using R via RStudio
3
Finding your way around RStudio
3.1
Console pane
3.2
Source pane
3.3
Environment/History pane
Environment tab
History tab
3.4
Files/Plots/Packages/Help/Viewer pane
Files tab
Plots tab
Packages tab
Help tab
Viewer tab
4
Introduction to R
4.1
Workflow
4.2
Working directory
4.3
Variables and assignment
4.3.1
Shortcuts
4.4
Using variables
4.5
Comments
4.6
Precedence
4.7
Mathematical functions
4.8
Data types
4.9
Data structures
Vectors
Matrices
Lists
Data frames
4.10
R Packages
5
Getting R help
5.1
Using R help
5.2
R “Cheatsheets”
5.3
R books
5.4
How to interpret R help files
5.5
Debugging
6
How to ask for help
7
Best practices
7.1
File organization
7.2
Comments
7.3
Spacing
7.4
Names
7.5
Template
7.6
Checklist
8
Entering and loading data
8.1
Entering data
8.2
Loading or importing data
8.2.1
The programmatic way (i.e., command line)
8.2.2
The RStudio way (the “import” feature)
8.2.3
Loading data hosted on a url
8.3
Inspecting the data
9
Handling data
9.1
Base R
9.1.1
Useful functions
9.1.2
Extracting rows and columns
9.2
dplyr
9.2.1
Selecting a column
9.2.2
Adding a new column
9.2.3
Sorting the data
9.2.4
Filtering data
9.2.5
Removing NA entries in data
9.2.6
Grouping
9.2.7
Joining
9.2.8
Pipes
9.3
Reshaping Data
9.3.1
Reshaping data from wide to long format
9.3.2
Reshaping data from long to wide format
10
Making graphs in R
10.1
Making graphs in R
10.2
Scatter plots with
plot(x,y)
10.3
Adding axes labels and changing symbols
10.3.1
Getting a bit more sophisticated
10.4
Line graphs
10.5
Boxplot
10.6
Other useful plot functions
10.7
Exporting your graphs
10.8
pch cheatsheet
11
Statistics in R
11.1
Comparing two means of a population or sample(s) using a t-test
11.2
Types of tests
11.3
p-values and statistical significance
11.4
t.test
11.5
Correlation
11.5.1
cor(x,y)
11.6
Simple linear regression
11.6.1
Adding lines of best fit with ggplot
12
Data and metadata
12.1
Data
12.1.1
Data guidelines
12.1.2
Database structure guidelines
12.2
Metadata
12.2.1
Metadata guidelines
12.3
Further reading
PART II: ADVANCED
13
Writing functions
13.1
Introduction
13.2
Writing your own functions
13.3
Returning Multiple Outputs
14
Loops and repeating commands
14.1
Introduction
14.2
for loops
14.3
Loop alternatives
15
ggplot
15.1
Introduction
15.2
Making scatter plots with ggplot2
15.3
Customising graphs
15.4
Bar plots
15.5
Facet wrapping
15.6
Other types of plots
15.7
Further reading
16
Making maps
16.1
Introduction
16.1.1
Required packages
16.2
Creating maps using
ggplot2
and
sf
16.3
Changing map colours
16.4
Projections
16.5
Map Extent
16.6
Mapping points
16.7
Scale bar and north arrow
16.8
Finalizing the map
16.8.1
Exporting your map
16.9
Additional Reading
17
R markdown
17.1
Introduction
17.1.1
Installation
17.2
Setup
17.3
Rendering to a document
17.4
Formatting
17.4.1
Syntax
17.4.2
Headers
17.4.3
Lists
17.4.4
Figures
17.4.5
Tables
17.5
Further Reading
18
Coding club at MUN
19
Contributions
Appendix
A
FAQ
A.1
Download and Installation Issues
A.2
Computer Issues
A.3
RStudio Error Messages
B
Glossary
References
C
Hypothesis, predictions and equations
C.1
Discrete and continuous variables
C.2
Hypothesis testing
C.2.1
Null hypotheses
C.3
Further reading
C.4
Status
Quantitative skills for biology
References