Why R? and other questions

Dylan Craven & Patrick Weigelt

April 14th, 2021

Overview

  • R & You
  • Why R?
  • What is R?
  • Basics of R & RStudio
  • R Data science resources
  • Where to get help with R
  • Create a R project

R & You

  • Tools you need to acquire and strengthen as a graduate student:
    • Think critically (identify & assess problems)
    • Solve problems
    • Communicate problems and possible solutions
  • R is one of many tools, but it’s also becoming a marketable skill (outside of science too!)

Why R?

  • Transparency
  • Reproducibility
  • Open science & lowering barriers

What is R? (part I)

  • Statistical computing environment
    • Basic statistics (e.g. ANOVA, T-tests)
    • Complex modeling (machine learning, Bayesian stats, simulations…)
  • Database manager

What is R? (part II)

  • Graphic design
  • GIS
  • Version control (via Github, etc.)
  • Publisher (basic word processing, web pages, scientific articles, theses, books…)

Basics of R & RStudio

Basics of R & RStudio

  • Integrated environment between scripts, output, figures, etc.
  • Easy to configure
  • Large online user community for help
  • Lots of online courses (e.g. Datacamp, Coursera…)

R Data science resources

Where to get help with R

Starting with R & RStudio: create a project (part I)

  • Open RStudio
  • File | New Project
  • Select either ‘New Directory’ or ‘Existing Directory’
    this will be the working folder for our course (on your computer)
  • Locate the project on your computer in a place (e.g. ’~/Courses/Macroecology)
  • Name your project
  • Within your project’s folder, create three sub-folders:
    • data
    • code
    • figures

Starting with R & RStudio: create a project (part II)

  • Open a new file: File | New File | R script

  • Type: # Day 1: getting started

  • Save file (in ~/code): “0_Code_Day1.R”

  • Start coding!