Introduction to R and Statistical Computing Course
Instructor: Ben Weinstein
Location: Life Sciences 038, Stony Brook University.
Time: Beginning Jan 27th, Mon 2- 4pm & Weds., 9-11 AM – lasting three weeks.
Size: 40 Students – first come first serve, open to all.
Aim: Introduce incoming biometry students to statistical coding and plotting using R. It will focus on peer learning, hands on examples, and active problem solving. The overall goal is to demystify R and arm students with the skills needed to succeed in Biometry and as researchers. I urge both novice and intermediate R users to attend.
Approach: The course format will focus on specific concepts and skills using markdown slides (links below). A worksheet, along with answers, is provided to reinforce the tools. Before each class, please review the Intro to R youtube series (embedded below), reviewing the video sections labeled in red.
Location: Life Sciences 038, Stony Brook University.
Time: Beginning Jan 27th, Mon 2- 4pm & Weds., 9-11 AM – lasting three weeks.
Size: 40 Students – first come first serve, open to all.
Aim: Introduce incoming biometry students to statistical coding and plotting using R. It will focus on peer learning, hands on examples, and active problem solving. The overall goal is to demystify R and arm students with the skills needed to succeed in Biometry and as researchers. I urge both novice and intermediate R users to attend.
Approach: The course format will focus on specific concepts and skills using markdown slides (links below). A worksheet, along with answers, is provided to reinforce the tools. Before each class, please review the Intro to R youtube series (embedded below), reviewing the video sections labeled in red.
Introduction to R - What is it?
Slides and Worksheet (Answers)
Slides and Worksheet (Answers)
- Introduction to R and Rstudio
- Basic Math
- Vectors
- Intro to R: 1.1 to 1.3; please skim Hadley Wickham's Introduction
Probability and Distributions
Slides and Worksheet (Answers)
Slides and Worksheet (Answers)
- Drawing from Distributions
- Univariate Plots
- Intro to R: 1.4 to 1.5
Data Manipulation
Slides and Worksheet (Answers)
Slides and Worksheet (Answers)
- Dataframes
- Logical Statements
- Subsetting
- Intro to R: 2.1 - 2.2
- For more on subsetting: http://adv-r.had.co.nz/Subsetting.html
Loops and Flow Statements
Slides and Worksheet (Answers)
Slides and Worksheet (Answers)
- For Loops - Basic Math
- For Loops - Vectors
- If, next, break flow statements
- Intro to R: 2.3 - 2.6; optional: 3.2, 4.6
Data Exploration and Plotting
Slides and Worksheet (Answers)
Slides and Worksheet (Answers)
- Importing Data - Traits.csv needed for this lesson available here.
- Descriptive Summary Statistics
- Introduction to ggplot2; see additional slides
- There are many intro to ggplot guides; here, here, and video here
Beyond Biometry
Slides and Worksheet (Answers)
Slides and Worksheet (Answers)
- User Defined Functions
- Best practices
- Github and version control, and why it is critical for modern science*
- Intro to R: 4.1 - 4.2;
* To navigate to the desired video, click on the playlist dropdown menu in the top left corner.
Acknowledgements
Thanks to Karthik Ram and Software Carpentry for all their hard work and leadership in teaching R. The original repo and my forked files can be found on github. Special thanks to Sarah Supp for her help on connecting with this group. Also thanks to Dan Rabosky, whose R seminar at Berkeley provided additional components for this work. Thanks to google developers for the Intro to R youtube videos!