Below are a set of tasks that we will work on in class (either alone or in small groups).


CS_01 : Your first script

Write a script that reads in data, calculates a statistic, and makes a plot.

Full Description

Tasks

  • Create a new R script in RStudio (File->New File->R Script)
  • Save this file somewhere you will find it later
  • In your new script, load the iris dataset with data(iris)
  • Read the help file for the function that calculates the mean (you can run ?mean or use the GUI).
  • Calculate the mean of the Petal.Length field and save it as an object named petal_length_mean
  • Plot the distribution of the Petal.Length column as a histogram (?hist)
  • Save the script
  • Click ‘Source’ in RStudio to run your script from beginning to end

TK_01 : Getting Started

Full Description

Readings

Tasks

  • Read the course syllabus and make sure you understand our class routine and grading
  • Install R on your computer from here if you haven’t already installed it.
  • Install RStudio Desktop (free version) on your computer from this source
  • Join the Slack Channel by following the link sent via email (ask if you did not receive this link)
  • Join our DataCamp class following the link sent via email. Start working on the first assignment (try to finish by Thursday)
  • Create a GitHub account and submit your github username to the form sent to your email. This username may follow you for years, use something professional that you will want to share with your future employer.

CS_02 : My grandfather says summers are getting hotter

Import data and plot a timeseries

Full Description

Readings

Tasks

  • Create a new R script in RStudio
  • Load data from a comma-separated-values formatted text file hosted on a website
  • Graph the annual mean temperature in June, July and August (JJA) using ggplot
  • Add a smooth line with geom_smooth()
  • Add informative axis labels using xlab() and ylab() including units
  • Add a graph title with ggtitle()
  • Save a graphic to a png file using png() and dev.off() OR ggsave
  • Save the script
  • Click ‘Source’ in RStudio to run the script from beginning to end to re-run the entire process


CS_03 : Wealth over time

Data wrangling plus more advanced ggplot

Full Description

Tasks

  • Recreate layered graphics with ggplot including raw and transformed data
  • Save graphical output as a .png file
  • Save your script as a .R or .Rmd in your course repository

TK_03 : Git Repository

Start using Github to manage course materials

Full Description

Tasks

  • Watch the Git GUI
  • Install git on your computer
  • Configure Git
  • Make sure git works in R-Studio (do you see the Git tab in the upper right?)
  • Optionally sign up for the GitHub Education pack
  • Click on this link to create a repository for your case studies
  • Set up it credentials following this
  • Create a new project in Rstudio and connect it to the new repository in GitHub. Helpful instructions are here
  • Make some change. For example, you could edit the README.md file in your repository to include a brief description of the repository (e.g. “Coursework for Spatial Data Science”).
  • Stage and Commit your changes to Git (using the git tab in the upper right of RStudio)
  • Push the repository up to GitHub
  • Confirm that the changes are visible on your github webpage
  • Copy the contents of your scripts from previous weeks into the appropriate files (but don’t edit the file names!)

CS_04 : Farthest airport from New York City

Joining Relational Data

Full Description

Tasks

  • Join two datasets using a common column
  • Answer a question that requires understanding how multiple tables are related
  • Save your script as a .R or .Rmd in your course repository

TK_04 : Data Wrangling 2

Joining data

Full Description

Readings

Tasks

  • Confirm that all tasks and case studies you have completed have been committed in your course repository and pushed to Github.
  • Look ahead at Task 6 (Project Proposal) and start thinking about possibilities
  • Post at least one rough project idea (with links, etc.) to Slack in the Projects Channel.

CS_05 : Beware the Canadians!

Working with Spatial Data and the sf package

Full Description

Tasks

  • Reproject spatial data using st_transform()
  • Perform spatial operations on spatial data (e.g. intersection and buffering)
  • Generate a polygon that includes all land in NY that is within 10km of the Canadian border and calculate the area
  • Save your script as a .R or .Rmd in your course repository

TK_05 : Spatial Vector Data

Vector data processing. Integrating ‘traditional GIS’ analyses with statistical modelling. Data intersection, overlays, zonal statistics

Full Description

Readings

Tasks

  • Keep thinking about your projects!

CS_06 : Find hottest country on each continent

Use sf and raster to quantify mean annual temperature for each country and then identify the hottest one on each continent.

Full Description

Readings

  • Raster Vector Interactions GCR

Tasks

  • Calculate annual mean temperatures from a monthly spatio-temporal dataset
  • Remove Antarctica from the world dataset
  • Summarize raster values within polygons
  • Generate a summary figure and table.
  • Save your script as a .R or .Rmd in your course repository

TK_06 : Spatial Raster Data

Gridded spatial data

Full Description

Readings

Tasks

  • Take 10 deep breaths. You are doing ok!

CS_07 : Getting Help!

Learning more about finding help

Full Description

Tasks

  • Learn how to read R help files effectively
  • Learn how to search for help
  • Learn how to create a Minimum Working Example (MWE)
  • Debug existing code
  • Post your reprex as an ‘issue’ in github
  • Post your repex to slack

TK_07 : Project Proposal

Full Description

Readings

Tasks

  • Write your project proposal in a .Rmd file
  • Compile the .Rmd to .md using the “Knit” button
  • Push both the .Rmd and .md to Github
  • Post links to your project proposal .md file in the Projects Channel on Slack.

CS_08 : One Script, Many Products

RMarkdown to create dynamic research outputs. Publishing to github/word/html/etc

Full Description

Readings

Tasks

  • Build a RMarkdown document that downloads a dataset, produces one graph and one table, and exports to four different formats (HTML, GitHub Markdown, Word, Powerpoint).

TK_08 : Create Final Project Webpage

Data I/O. RMarkdown to create dynamic research outputs. Publishing to github/word/html/etc

Full Description

Readings

Tasks

  • Create repository for final project
  • Explore various options for your project website
  • Push changes back to GitHub
  • Enable website on GitHub

CS_09 : Tracking Hurricanes!

Analyze historical storm data from NOAA

Full Description

Tasks

  • Write a .Rmd script to perform the following tasks
  • Intersect the storms with US states to quantify how many storms in the database have hit each state.

TK_09 : APIs, time-series, and weather Data

Processing daily weather data from NOAA

Full Description

Readings

Tasks

  • Complete the Case Study for this week.

CS_10 : Satellite Remote Sensing

Analyze Satellite Data

Full Description

## Readings

Tasks

  • Extract a timeseries from a single location in a netcdf file (part 1)
  • Calculate a monthly climatology from a weekely timeseries (part 2)
  • Summarize Land Surface Temperature by Land Cover (part 3)

TK_10 : Remote Sensing

Processing MODIS data from NASA

Full Description

Readings

  • NULL

Tasks

  • Look through this week’s case study processing MODIS RS data
  • Take notes on interesting or useful things you learned in your course repository.
  • Keep working on your project!

CS_11_Solution : Parallel Computing with R

Write a parallel for loop

Full Description

## Readings

## Tasks


CS_11 : Parallel Computing with R

Write a parallel for loop

Full Description

Tasks

  • Download spatial data from the U.S. Census
  • Write a parallel foreach() loop to generate a point representing each person in each census polygon (block/tract)
  • Set the output of the foreach() funtion to return a spatial (sf) object
  • Make a ‘dot map’ of the racial distribution in Buffalo, NY.

TK_11 : Project First Draft

Submit the first draft of your project for peer review

Full Description

Readings

Tasks

  • Commit your first draft of your project to GitHub

CS_12 : Dynamic HTML graph of Daily Temperatures

Using DyGraph library.

Full Description

Readings

Tasks

  • Download daily weather data for Buffalo, NY using an API
  • Generate a dynamic html visualization of the timeseries.
  • Save the graph to your project folder using Export->Save as Webpage

CS_15 : Final Challenge

Full Description

## Readings

## Tasks


Readings

Tasks

  • Review at least two other students’ projects and make comments via a pull request in GitHub.

Readings

Tasks

  • Bring any questions to class on Tuesday.

TK_14 : Project Workshop

Full Description

Readings

  • NULL

Tasks

  • Continue working on final project
  • Finish any remaining DataCamp courses
  • Ask questions!
  • Start working on your Grade Request Letter

TK_15 : Final Presentation

Present your project to the class

Full Description

Readings

Tasks

  • Commit second (or final) version of final project to GitHub
  • Prepare to give your 5 minute presentation
  • Present your analysis to your roommates, significant other, etc. and update your presentation based on the feedback
  • Get feedback from 2-3 fellow classmates on your presentation and update it based on their feedback
  • Give your 5 minute presentation in class

TK_16 : Publish Final Project

Commit the final version of your project

Full Description

## Readings

Tasks

  • Finalize your project and commit to GitHub
  • Confirm the final version renders correctly on your website

TK_17 : Publish Final Project

Commit the final version of your project

Full Description

## Readings

Tasks

  • Finalize your project and commit to GitHub
  • Confirm the final version renders correctly on your website