1. 학습
  2. /
  3. 강의
  4. /
  5. Visualizing Geospatial Data in R

Connected

연습 문제

A first plot

So far, you've read in some spatial files, transformed spatial data to the same projection, and merged a data frame with a spatial object. Time to put your work together and see how your map looks. For each dataset, you need a tm_shape() call to specify the data source, followed by a tm_* layer (like tm_fill(), tm_borders() or tm_bubbles()) to draw on the map.

First, you'll add the neighborhoods and water areas to your plot from the previous exercise.

지침

100 XP
  • Add a layer for the water object with tm_shape(). Then use tm_fill() and set the color to "grey90".
  • Similarly, add a layer for the neighborhoods object. Use tm_borders() to draw the neighborhood outlines.