R for Marine Scientists
  • Home
  • Modules
    • 1 · Intro to R & RStudio
    • 2 · Basic Programming
    • 3 · Data wrangling
    • 4 · Plotting with ggplot2
    • 5 · Reporting with R Markdown
  1. 🏠 Home
  • 🏠 Home
  • Modules
    • 1 · Intro to R & RStudio
    • 2 · Basic Programming
    • 3 · Data wrangling
    • 4 · Plotting with ggplot2
    • 5 · Reporting with R Markdown

R for Marine Scientists

A hands-on tutorial using real whale survey data

🐋 R for Marine Scientists

A five-module, hands-on introduction to R programming using real-world whale survey data. No prior coding experience required.

Welcome

This tutorial teaches you to use R and RStudio for data analysis in the context of marine biology. By the end you will be able to import messy field data, clean and reshape it with the tidyverse, create publication-quality figures with ggplot2, and write reproducible reports with R Markdown — all skills immediately applicable to cetacean research.

Each module builds on the previous one and uses the same real dataset throughout.


Modules

Module 1
Intro to R & RStudio

Install R and RStudio, navigate the IDE, understand the console and script editor, and run your first lines of code.

Module 2
Basic Programming Operations

Arithmetic, variables, data types, vectors, functions, and control flow — the building blocks of every R program.

Module 3
Data wrangling

Read CSV survey data, clean column names, filter, mutate, and summarise with tidyverse packages.

Module 4
Plotting with ggplot2

Plot survey data using the ggplot2 package.

Module 5
Reporting with R Markdown

Weave code, results, and prose into polished HTML and PDF reports that update automatically when data changes.


Prerequisites

You need Notes
A computer (Windows, macOS, or Linux) Admin rights to install software
R ≥ 4.3 Download from CRAN
RStudio ≥ 2023.12 Download from Posit
Internet connection For installing packages

No prior programming experience is assumed.


How to use this site

  1. Work through modules in order — later modules assume earlier knowledge.
  2. Every code block can be copied with the clipboard icon at the top right.
Tip

Tip: Keep an RStudio project open alongside this site and paste code into your own scripts as you read. Active practice is the fastest way to learn R.

Source Code
---
title: "R for Marine Scientists"
subtitle: "A hands-on tutorial using real whale survey data"
page-layout: full
toc: false
---

```{=html}
<div class="hero">
  <h1>🐋 R for Marine Scientists</h1>
  <p>A five-module, hands-on introduction to R programming using real-world whale survey data. No prior coding experience required.</p>
</div>
```

## Welcome

This tutorial teaches you to use **R and RStudio** for data analysis in the context of marine biology. By the end you will be able to import messy field data, clean and reshape it with the **tidyverse**, create publication-quality figures with **ggplot2**, and write reproducible reports with **R Markdown** — all skills immediately applicable to cetacean research.

Each module builds on the previous one and uses the same real dataset throughout.

---

## Modules

```{=html}
<div class="module-grid">

  <a class="module-card" href="module1.qmd">
    <div class="card-num">Module 1</div>
    <div class="card-title">Intro to R &amp; RStudio</div>
    <p class="card-desc">Install R and RStudio, navigate the IDE, understand the console and script editor, and run your first lines of code.</p>
  </a>

  <a class="module-card" href="module2.qmd">
    <div class="card-num">Module 2</div>
    <div class="card-title">Basic Programming Operations</div>
    <p class="card-desc">Arithmetic, variables, data types, vectors, functions, and control flow — the building blocks of every R program.</p>
  </a>

  <a class="module-card" href="module3.qmd">
    <div class="card-num">Module 3</div>
    <div class="card-title">Data wrangling</div>
    <p class="card-desc">Read CSV survey data, clean column names, filter, mutate, and summarise with tidyverse packages.</p>
  </a>

  <a class="module-card" href="module4.qmd">
    <div class="card-num">Module 4</div>
    <div class="card-title">Plotting with ggplot2</div>
    <p class="card-desc">Plot survey data using the ggplot2 package.</p>
  </a>

  <a class="module-card" href="module5.qmd">
    <div class="card-num">Module 5</div>
    <div class="card-title">Reporting with R Markdown</div>
    <p class="card-desc">Weave code, results, and prose into polished HTML and PDF reports that update automatically when data changes.</p>
  </a>

</div>
```

---

## Prerequisites

| You need | Notes |
|---|---|
| A computer (Windows, macOS, or Linux) | Admin rights to install software |
| R ≥ 4.3 | [Download from CRAN](https://cran.r-project.org) |
| RStudio ≥ 2023.12 | [Download from Posit](https://posit.co/download/rstudio-desktop/) |
| Internet connection | For installing packages |

No prior programming experience is assumed.

---

## How to use this site

1. Work through modules **in order** — later modules assume earlier knowledge.
2. Every code block can be **copied** with the clipboard icon at the top right.


::: {.callout-tip}
**Tip:** Keep an RStudio project open alongside this site and paste code into your own scripts as you read. Active practice is the fastest way to learn R.
:::
 

R for Marine Scientists · Built with Quarto