Syllabus

Spatial Data Analysis with R (01:450:320)

1 Overview

Originally developed for statistics, R is a free and open-source programming language that has become a cornerstone of both industry and academia. Among its many applications, R is increasingly used for geospatial analyses, as evidenced by its growing ecosystem of spatial libraries (covering everything from basic vector and raster manipulation to advanced modeling and image processing), the evolution of classes for representing spatial data, its expanding capacity to interact with and leverage the capabilities of other geospatial libraries (GDAL) and GIS (e.g. GRASS, QGIS, PostGIS, SAGA).

Alongside these spatial capabilities, the evolution of Integrated Development Environments (IDEs) has transformed R into a “one-stop shop” for the modern GIScientist, facilitating reproducible and interactive research. This course equips students with the skills to leverage R as a powerful Geographic Information System (GIS). Beyond spatial analysis, we will emphasize core programming proficiency, reproducibility, and professional presentation. Students will learn to develop R packages, author reports using R Markdown, and manage workflows via Git/GitHub, all while applying these skills to a specific, real-world research problem.

1.1 Meeting Time/Place

Lucy Stone Hall (LSH-B266), MW 3:50PM - 5:10PM

1.2 Office Hours

Instructor Office Office hours
Lei Song Lucy Stone Hall (B249) Wed 1:50PM - 3:50PM
Md Arafat Hassan (TA) Lucy Stone Hall (B272) Mon 2:30PM to 3:30PM

1.3 Philosophy

Although our primary focus is learning how to use R for geospatial analysis, the course also introduces additional skills and concepts related to reproducible research.

1.4 Caveats/things to consider

Here are some other aspects regarding this course that you may wish to consider before committing:

  1. Assignments in this class are problem-oriented, not recipe-based:

    I believe that the best way to learn R (and any human or computational language, for that matter) is to figure out how to use it to solve specific problems. There are usually multiple paths that can be taken to solve a problem, particularly in R, which has a huge number of contributors and over 10,000 packages. Coding recipes that spell out precise steps needed to arrive at a solution will not take you as far towards R fluency, and will prevent you from learning the diversity of this language.

    It can be very rewarding to figure out programming problems (I personally prefer programming to writing papers), but it can often be frustrating. Feeling frustrated is quite normal, and please don’t take it as a sign that you are not good at programming, or that it is not for you.

  2. The order in which material is introduced will occasionally be non-linear:

    Primarily because we are introducing reproducibility concepts up front in this class, which entails learning about some things that people might ordinarily get around to after they know a bit of R code. However, I believe that this order of things will enable you to learn R (or any other programming language) more rapidly. It might even make it more fun.

  3. This is a flipped class:

    Materials and problems are expected to be done before class. This is particularly true this semester, when we are working more than half the time in an online mode. There will be some lecturing on key concepts, but class is intended to function more like a lab (and the lab period is intended for students seeking extra help), in which you work through practical problems, clarify concepts that are unclear, or present your work to your peers.

1.5 Required Texts, Reading, Quizzes, and Assignments

There is no required textbook for this course. There is a huge amount of well-developed R material that is freely available on the web. We draw on and those resources for this class and integrate them into our own content (citing/linking to show where they come from).

Readings and practices should be completed before the class they are listed under. This is key to learning the language, as it is difficult to learn programming by just listening to lectures.

Practical assignments. During the first two units, there will be a total of 5 assignments (see links within the individual modules). Deadlines are listed on the course schedule. All work must be submitted via GitHub by midnight on the Friday of the assigned week. You will need to join GitHub (it’s free!) to be able to submit assignments.

Quizzes. Following each assignment deadline, there will be an in-class, closed-book quiz covering the programming concepts from that assignment. While quiz scores do not directly add to your final grade, they act as a cap for the corresponding assignment grade. Check Assessment for more details.

Projects Each student will be required to undertake a final project. Please see the projects page for more detail.

1.6 Style

There are many ways to write code and get the results you want. However, not all ways of writing code are equal. Some code is messy and hard to read. Other code is organized, clean, and easy to read. The latter is what we are aiming for, as it helps to foster reproducibility. In this class, we will follow Hadley Wickham’s style guide. Please study it.

1.7 Assessment and engaged time

Your progress in this class will be assessed as follows:

Component Grade
Practical assignments (n = 5) 40%
Participation 10%
Overview for final project 10%
Oral defense for final project 10%
Final project 30%

Grading will be based on the rubrics found under the Assessment vignette.

Courses at Rutgers-New Brunswick are worth 3 credit hours, which equates to 135 hours of engaged academic time. The breakdown of that time is estimated to be:

Component Hours
Class meetings 37
Readings 13
Practicals 30
Semester projects-analysis 40
Semester projects-presentation 5
Semester projects-final report 10
Total hours 135

1.8 Expectations

Since class is flipped, this is a time for questions and discussion, between us and you, and often between yourselves. However, please keep any conversations low and necessary to the task at hand if they are one-on-one.

Class attendance is expected. It is the primary time in which to get help on understanding reading materials and assignments (see next section on Communications). Late assignments (including presentations and final report) are not accepted, barring any emergency or reasonable conflicts that prevent on-time submissions.

For practical assignments in the first two units, students can work together to figure out coding problems and to understand the material, but final assignments should reflect each student’s own work and coding effort (i.e. not copying code from someone else). For final projects, many, if not most, of the projects will be team-based (2-3 per team, depending on the nature of the assignment) on some if not all of the available topics.

We will follow the University’s policies on plagiarism and cheating. Please familiarize yourself with the University’s policy on academic integrity.

1.8.1 Communications

We will conduct class communications via a Google chat that you should already be invited to. Please don’t send emails as they will go unanswered. Class-wide discussions will be conducted in the main channel. Individual and restricted group messaging will be conducted via direct messaging, e.g. grade reporting, confidential questions.

1.9 Academic Integrity Policy

Rutgers University takes academic dishonesty very seriously. By enrolling in this course, you assume responsibility for familiarizing yourself with the Academic Integrity Policy and the possible penalties (including suspension and expulsion) for violating the policy. As per the policy, all suspected violations will be reported to the Office of Student Conduct. Academic dishonesty includes (but is not limited to):

  • Cheating. For example, use of external websites or other resources to obtain solutions to homework assignments, quizzes, or exams is cheating.
  • Plagiarism
  • Aiding others in committing a violation or allowing others to use your work. For example, posting homework assignments, or exams, to external sites without the instructor’s permission.
  • Failure to cite sources correctly.
  • Fabrication
  • Using another person’s ideas or words without attribution–re-using a previous assignment.
  • Unauthorized collaboration
  • Sabotaging another student’s work.

If in doubt, please consult the instructor. Please review the Academic Integrity Policy and the resources for students.

Honor pledge: All students will have to commit to the Rutgers Honor Pledge: On my honor, I have neither received nor given any unauthorized assistance on this examination (assignment, paper, quiz, etc.).

1.10 Generative AI Policy

In this course, we recognize that Generative AI (e.g., ChatGPT or Gemini in Google Search) is an evolving part of the modern data science workflow. You are permitted to use these tools but only in an assistant capacity, provided you adhere to the following standards of Authentic Authorship:

Permitted Uses (the “Assistant” Model):

  • Grammar and Composition: Refining the wording of your reports or clarifying the language in your project overview.

  • Brainstorming: Exploring potential research questions or identifying available spatial datasets.

  • Debugging: Inputting error messages to understand why a specific function failed and learning how to fix it.

  • Code Explanation: Asking an AI to explain a complex R function or a spatial concept in plain English.

1.10.1 The “Human-in-the-Loop” Expectation

All submitted assignments and projects must be your original work. While AI can assist in the process, you must possess a deep and thorough understanding of every function, package, and spatial concept included in your submission.

Note: If any AI-generated content in your submission is found (e.g., a non-existent function or a fabricated reference), a formal academic integrity report will be initiated immediately.

1.11 Disability Accommodations

Rutgers University welcomes students with disabilities into all of the University’s educational programs. To receive consideration for reasonable accommodations, if you are a student with a disability, you must contact the appropriate disability services office at the campus where you are officially enrolled, participate in an intake interview, and provide documentation. If the documentation supports your request for reasonable accommodations, your campus’s disability services office will provide you with a Letter of Accommodations. Please share this letter with me and the teaching assistant and discuss the accommodations with us as early as possible. To begin this process, please complete the Registration on the ODS web site.

1.12 Student Support and Mental Wellness

The faculty and staff at Rutgers are committed to your success. Students who are successful tend to seek out resources that enable them to excel academically, maintain their health and wellness, prepare for future careers, navigate college life and finances, and connect with the RU community. Resources that can help you succeed and connect with the Rutgers community can be found at success.rutgers.edu, and nearly all services and resources that are typically provided in-person are now available remotely.

You may also find these services useful:

2 Course Structure

The following is an overview of the course structure, broken down by Unit, with a listing of the material to be covered each week, including the week in which unit assignments are due (assignments are due by midnight on Friday during the indicated week). Note that the course schedule is subject to change, please check the alive course site for the most recent updates.

2.2 Unit 2. Handling and analyzing spatial data with R

In this part of the course we will start to learn to use R as a GIS. The detailed syllabus can be found in the Unit 2 vignette.

2.2.1 Week 7. Introduction, working with vector data

2.2.2 Week 8. Vectors continued

  • Unit 2 Module 1 assignment (#4) due

2.2.3 Week 9. SPRING BREAK - NO CLASS

2.2.4 Week 10. Working with raster data

2.2.5 Week 11. Raster data continued

  • Unit 2 Module 2 assignment (#5) due

2.3 Unit 3. Projects

2.3.1 Week 12. Project selection

  • Final project overview due

2.3.2 Weeks 13-15 - Project work

  • Project oral defense (Mon of Week 13)

Students will spend this time working on their projects, with a particular focus on working with us to identify and trouble-shoot methods.

The class periods in this week can be used for continued project work. The final project will be submitted during the exam week.

3 Resources

The following are some helpful resources that you may wish to follow-up on as you learn R.

3.1 Books etc

3.2 The intertubes

3.2.3 Reproducibility

3.2.4 R versus python

This is a big topic, but here are a few links to get started. Lately the two seem to be converging in terms of usage (i.e. there is a trend towards using both together, read the latest news from Rstudio–see the first link)

3.2.5 R spatial

3.2.6 Blogs/twitter to follow