-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathINTRO.Rmd
85 lines (58 loc) · 6.94 KB
/
INTRO.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
---
title: "A course in the R statistical computing language by video podcast"
date: "`r format(Sys.time(), '%d %B %Y')`"
output:
html_document:
theme: flatly
toc: true
toc_depth: 4
number_sections: no
---
I have been playing around with teaching R through downloadable video podcasts and feel that it works well for getting people up to speed with some of the basics in a user-friendly way. I have also decided to stick with the open-source ethos for R and provide these to all users who want access. As is the case with all programming languages, there is always more than one way to do something, and these represent my own personal preference for a variety of analyses (at least in terms of teaching others how to do them). These demonstrations are for Windows OS for the time being. Mac/Linux users will have to learn some conversions for some commands. I am moving my day-to-day computing over to Mac anyway, so one day I will probably end up with Mac only demonstrations. The course is ever expanding, and I will be adding new chapters as time goes on. If there is an analysis you would particularly like to see, I might be able to create a podcast so please contact me with your suggestions and requests (a.jackson(at)tcd.ie).
## Pre-requisites
- You will of course need to install [R](https://cran.r-project.org/) before you can follow along with the podcast course. The latest version is `r version$version.string`
- I strongly recommend you run R through the Interactive Development Environment (IDE) [Rstudio](https://www.rstudio.com) which is also free to download: basically this makes using R much more user-friendly and includes lots of nice additional point and click features for shortcuts, colour-codes your script files and generally tidies up your workspace. The latest version is v1.2.1335 (as of `r format(Sys.time(), '%d %B %Y')`).
- There are also some script template files and datafiles (I suggest you right click and save these to your local disk) to accompany some of the podcasts below. These can be downloaded from our [github site](https://github.com/adzidic/R_lectures): click the button "clone or download" to get a zip file containing the entire course content.
- The podcast videos are available from the my [YouTube channel ](https://www.youtube.com/playlist?list=PLXXzyqr0tEhPRNDuEQ6wcvMcpAkGRjVqs)
- If you are following along in a class room or public place, you will need some earphones.
- If you are working in computer rooms in Trinity College Dublin, you should be able to access Rstudio and R as they are included as standard software. They may not be the most up-to-date versions however, but I believe it is possible for you to install your own software into a personal app area. If you plan on using college computers then I strongly recommend you familiarise yourself with the set up in advance of our classes.
## Recommended Reading
- The main book I recommend for students learning both statistics and R at the same time is [Statistics: An introduction using R](https://www.wiley.com/en-ie/Statistics%3A+An+Introduction+Using+R%2C+2nd+Edition-p-9781118941102) by Michael Crawley. This book is relatively inexpensive and has the advantage that there is a larger more detailed version available (at considerably more expense) [The R Book](https://www.wiley.com/en-ie/The+R+Book%2C+2nd+Edition-p-9781118448960) which allows you to go into more detail and explore more advanced statistics. I dont recommend you buy this larger book unless you really want it, and most academic libraries will likely have a copy.
- If you already know a reasonable amount of statistics using other software, and want to get up to speed in R quickly, then [Getting Started with R](https://global.oup.com/academic/product/getting-started-with-r-9780198787846?cc=ie&lang=en&) by Beckerman, Childs and Petchey is a great small book to get you going.
- There are also lots of free online resources available, and you can't go wrong with Hadley Wickhams [R for Data Science](http://r4ds.had.co.nz) and he has lots of very advanced and easy to follow books on how to write packages.
## Course Content
The course is broken into sections, designed to increase in complexity towards Generalised Linear Models which would represent the majority of modelling used in ecology or environmental science which are the subject areas I teach. Not all the scripts in this github repository have associated podcasts, and I hope to complete these over time. The podcast link should take you to a youtube video, and the "RMarkdown Lx"" designation points you to which folder and file in the github repository you should look for the associated datasets and Rmarkdown scripts used in the corresponding podcast.
### Introduction to R for first time users
1. Opening R for the first time: [podcast](https://youtu.be/GvhbhYvwxvA), RMarkdown L1
a. Introduction to scripts, Rmarkdown and Rnotebooks: [podcast](https://youtu.be/ddgNEeD0TQ8), no script accompanies this podcast.
b. First Figures in R: [podcast](https://youtu.be/3PbKwf1w3Zs), no script accompanies this podcast
2. Working with script files: [podcast](https://youtu.be/Nd8oQbL6qP0), Rmarkdown L2
3. Importing data into R: [podcast](https://youtu.be/64MZO2OKMDs), RMarkdown L3
4. Installing packages: Rmarkdown L4
### Basic graphics / plots in R
1. Histograms: [podcast](https://youtu.be/iQOR5cI4ZQQ), Rmarkdown L5
2. Scatter plots (including how to make pretty graphs). There are two podcasts associate with this single Rmarkdown script L6:
a. [podcast 1 - graphics in base R](https://youtu.be/QMu5riQ1rd8)
b. [podcast 2 - graphics in ggplot](https://youtu.be/0zQiItF8X9E)
3. Barplots: podcast coming soon, script
4. Errorbar plots: podcast coming soon, script
5. Boxplots: [podcast](https://youtu.be/6hw-pzGdLY8), Rmarkdown L9
6. Advanced Boxplots. There are two podcasts in this section:
a. [podcast - advanced boxplots in base R](https://youtu.be/hP_eGwgnXS4), Rmarkdown L10a
b. [podcast - advanced boxplots in ggplot](https://youtu.be/LCD7lc59yM4), Rmarkdown L10b
### Basic analyses in R
1. Generating summary statistics (includes an introduction to writing your own functions): Rmarkdown L11
2. Basic data manipulation (sort, subset, randomise, sample, etc...): coming soon.
3. Comparing two means with t-tests and their non-parametric analogues: Rmarkdown L13
### Analysis of Variance - ANOVA in R
1. ANOVA one-way: Rmarkdown L14
### General linear models in R
1. Simple linear regression: [podcast](https://youtu.be/x6ygUsKmjx8), Rmarkdown L15
2. Analysis of Covariance (ANCOVA - fixed and linear effects in general linear models): Rmarkdown L16
3. Multiple regression and model selection using AIC: pending
4. Mixed effects / multilevel / hierarchical regression models: pending
### Generalised linear models in R (non-normal errors)
1. Poisson regression: pending
2. Binary logistic regression: pending
3. Binomial regression for proportional data: pending
4. Survival models for time-to-event: pending