Assignment 2: Data wrangling

EVR 628- Intro to Environmental Data Science

Author
Affiliation

Juan Carlos Villaseñor-Derbez (JC)

Rosenstiel School of Marine, Atmospheric & Earth Science and Institute for Data Science & Computing

The big picture

Remember that the final goal is to have a GitHub repository where you can showcase your work. Assignment 1 was to create the repository, which should be essentially empty. Assignment 2 is to develop two R scripts to clean and explore a dataset of your choice. Your choice of data will lock you in a path: The third assignment will be to formally visualize the data you have cleaned up here. Your final project will leverage the data and visualizations you’ll produce to wrap it all together.

This assignment

Tasks: Develop two R scripts. One will be a data wrangling script that reads raw data (e.g. in .xlsx or .csv), performs data cleaning, transformation, or wrangling as needed, and exports a processed version of the data (.rds) to be used in later assignments. The second script read in the clean data and performs exploratory data visualizations, which will be exported as *.png files.

This assignment will require quite a bit of work on three fronts:

  1. Coming up with an idea for a final project
  2. Thinking about how you will get the raw data into a format that gets you closer to your final project, and
  3. Using lecture and live coding session materials–and function documentation–to help you build your cleaning and visualization pipeline.

I have included a list of potential data sources and ideas for final projects. Feel free to come up with your own ideas. I recommend choosing something you may be genuinely interested in, which will keep you motivated.

Grading Rubric (and checklist!)

  • 10%: README.md file, split as:
  • 40%: Your repository contains an R script called data_processing.R, saved to your scripts/01_processing folder that:
  • 40%: Your repository contains a script called exploratory_data_visualization.R, saved to your scripts/03_content folder that:
  • 10% : Reproducibility. I can clone your repo and reproduce your clean data and figures without having to modify your code.
ImportantImportant points

Don’t be lazy - Simply renaming columns or changing their order is not enough. Come talk to me, I guarantee we can find something to do to them.

Some examples of repositories that would get a 100%:

Turning in your assignment

  • Please share the link to your github repo via Canvas
  • The deadline for this assignment is October 11, 2026 by 11:59

Project ideas with different data sets

Below are examples of data sources and final project ideas. For the purpose of this assignment you are not expected to provide an answer. You will simply prepare the data necessary to eventually provide the answer.

Access tuna data from the WCPFC or IATTC and then:

  • Build a time series of catch-per-unit-effort for a species of your liking
  • Find the year in which total tuna catch peaked
  • Find the month where tuna catch is, on average, maximum
  • For every year, find the coordinates where tuna catch was the highest. Do we see any changes in it’s location?

Go to NOAA’s Physical Sciences Laboratory and find an interesting data set

  • Use monthly NINO3 to produce a figure of NINO / NINA years
  • Compare indices among them
  • Relate indices here to tuna catch data above

Export your data from strava1, and then:

  • Find your longest activity
  • Find your total traveled distance since you started logging activities
  • Find the average length of your runs
  • Analyze your trends in heart rate vs speed
  • Analyze the pace of runs performed with the Rosenstiel Running Club

Your dive watch should allow you to export your data2, although you might need a special cable / software.

  • Calculate how much time you’ve spent underwater per week, month, or year
  • If you have air pressure info associated (or you keep a dive log with it), calculate your Surface Air Consumption Rate
  • What’s your longest dive?
  • What’s your deepest dive?
  • What is the average depth of all your dives?
  • What is the maximum number of dives you have done in a single day? a week?
  • The National Center for Environmental Information NCEI contains loads of interesting data sets.
  • Animal tracking data from MoveBank
  • Vessel tracking data from Global Fishing Watch
  • Maybe you are in the midst of collecting data for your project. You don’t yet have the raw data, but you have a sense of what they will look like (number of columns, number of observations…). I can help you simulate the data and you can build a script that helps you get your data into an analysis-ready format.

Come to office hours and we can discuss ideas.

Footnotes

  1. Data will not exported as .csv but I can help work around that↩︎

  2. The data may not exported as .csv but I can help work around that↩︎