1. Learn
  2. /
  3. Courses
  4. /
  5. Visualizing Geospatial Data in R

Exercise

Let's take a look at a spatial object

We've loaded a particular sp object into your workspace: countries_sp. There are special print(), summary() and plot() methods for these objects. What's a method? It's a special version of a function that gets used based on the type of object you pass to it. It's common when a package creates new types of objects for it to contain methods for simple exploration and display.

In practice, this means you can call plot(countries_sp) and if there is a method for the class of countries_sp, it gets called. The print() method is the one called when you just type an object's name in the console.

Can you figure out what kind of object this countries_sp is? Can you see what coordinate system this spatial data uses? What does the data in the object describe?

Instructions

100 XP
  • Print countries_sp. Why isn't this very useful?.
  • Call summary() on countries_sp.
  • Call plot() on countries_sp.