• 1 Syllabus
    • 1.1 Is this course for you?
    • 1.2 General schedule
  • 2 Pre-course tasks
    • 2.1 Installing programs
    • 2.2 Getting familiar with RStudio
    • 2.3 Installing R packages
    • 2.4 Setting up Git and GitHub
    • 2.5 Course introduction
  • 3 Code of Conduct
    • 3.1 Expected Behavior
    • 3.2 Unacceptable Behavior
    • 3.3 Consequences of Unacceptable Behavior
  • 4 Group project assignment
    • 4.1 Specific tasks
    • 4.2 Quick “checklist” for a “good” project
    • 4.3 Expectations for the project
  • 5 Lecture slides
    • Introduction to the course
    • Finding and obtaining open datasets
    • Collaboration and teamwork
    • Era of reproducible and open science
  • 6 Management of R projects
    • 6.1 What is a project and why use it?
      • 6.1.1 RStudio and R Projects
      • 6.1.2 Exercise: Reading the READMEs
      • 6.1.3 Exercise: Better file naming
      • 6.1.4 Next steps after creating the project
    • 6.2 RStudio layout and usage
    • 6.3 Basics of using R
    • 6.4 Using auto-completion in RStudio
    • 6.5 R object naming practices
    • 6.6 Exercise: Make code more readable
    • 6.7 Automatic styling in RStudio
    • 6.8 Packages, data, and file paths
    • 6.9 Encountering problems and finding help
    • 6.10 Summary of session
    • 6.11 Final exercise: Group work
  • 7 Data management and wrangling
    • 7.1 “Messy” vs. “tidy” data
    • 7.2 Managing and working with data in R
    • 7.3 Load the packages and dataset
    • 7.4 Exercise: Become familiar with the dataset
    • 7.5 Select specific columns in a dataset
    • 7.6 Rename specific columns
    • 7.7 Chaining functions with the pipe
    • 7.8 Exercise: Practice what we’ve learned
    • 7.9 Filter the data by row
    • 7.10 (Re)Arranging the rows of your data by column
    • 7.11 Transform or add columns
    • 7.12 Exercise: Piping, filtering, and mutating
    • 7.13 Split-apply-combine: Summarizing data
    • 7.14 Converting between wide and long data
      • 7.14.1 Pivot from wide to long
      • 7.14.2 Pivot from long to wide
    • 7.15 Pivot, then split-apply-combine
    • 7.16 Saving datasets as files
    • 7.17 Final exercise: Group work
  • 8 Version control with Git
    • 8.1 What is version control?
    • 8.2 What is Git?
    • 8.3 Basics of Git
    • 8.4 Using Git in RStudio
    • 8.5 Exercise: Committing to history
    • 8.6 “Remotes”: Storing your repository online
    • 8.7 Exercise: Clone GitHub repository from RStudio
    • 8.8 Synchronizing with GitHub
    • 8.9 Exercise: Push and pull
    • 8.10 Dealing with file conflicts between the local and remote
    • 8.11 Exercise: Dealing with merge conflicts
    • 8.12 Collaborating using Git and GitHub
    • 8.13 Summary of session
    • 8.14 Final exercise: Group work
  • 9 Data visualization
    • 9.1 Basic principles for creating graphs
    • 9.2 Basic structure of using ggplot2
    • 9.3 Graph individual variables
    • 9.4 Plotting two variables
      • 9.4.1 Two discrete variables
      • 9.4.2 Discrete and continuous variables
    • 9.5 Exercise: Create plots with one or two variables
    • 9.6 Visualizing three or more variables
    • 9.7 Colours: Make your graphs more accessible
    • 9.8 Titles, axis labels, and themes
    • 9.9 Saving the plot
    • 9.10 Final exercise: Group work
  • 10 Analytically reproducible documents
    • 10.1 Why try to be reproducible?
    • 10.2 Creating an R Markdown file
    • 10.3 Exercise: Create another R Markdown document.
    • 10.4 Inserting R code into your document
    • 10.5 Exercise: Creating a table using R code
    • 10.6 Formatting text with Markdown syntax
      • 10.6.1 Headers
      • 10.6.2 General text formatting
      • 10.6.3 Lists
      • 10.6.4 Block quotes
      • 10.6.5 Adding footnotes
      • 10.6.6 Adding links to websites
      • 10.6.7 Inserting (simple) tables
      • 10.6.8 Inline R code
    • 10.7 Exercise: Practice using Markdown for writing text
    • 10.8 Inserting figures, as files or from R code
    • 10.9 Other R Markdown features
      • 10.9.1 Making your report prettier
      • 10.9.2 Collaborating on R Markdown documents
    • 10.10 Final exercise: Group work
  • Appendix
  • A Resources for learning
  • B Acknowledgements
  • C For Instructors
    • C.1 Workshop details
      • C.1.1 Instructor and helper number
      • C.1.2 Setting up teams
      • C.1.3 Before your session
      • C.1.4 First day
      • C.1.5 Throughout the sessions
      • C.1.6 Making use of the stickies
    • C.2 Lesson material details
    • C.3 Version control
      • C.3.1 About the slides
  • D License
  • References
  • Published with bookdown
  • Check out the material on GitLab

Reproducible Research in R

5 Lecture slides

Introduction to the course

Finding and obtaining open datasets

Collaboration and teamwork

Era of reproducible and open science