F Exercise 04

Last updated: 2021-01-16 22:29:07

F.1 Question 1

  • Read the Shapefile named nafot.shp, which includes polygons of “Nafa” administrative regions in Israel.
  • Calculate how many neighboring polygons each “Nafa” intersects with (not including self!).
  • Plot a map that shows the number of neighbors per “Nafa” (Figure F.1).
  • Remember: do not use specific values in your calculation, the number of neighbors needs to be calculated in the code!
Number of neighbors per "Nafa"

Figure F.1: Number of neighbors per “Nafa”

(50 points)

F.2 Question 1

  • Load the built-in data.frame object named world.cities from the maps package, as follows:
  • The world.cities object is a table with world cities of population greater than about 40,000. The table includes the longitude and latitude of each city in the long and lat columns, respectively.
  • Read the Shapefile named nafot.shp, which includes polygons of “Nafa” administrative regions in Israel.
  • Subset those cities which intersect with the “Nafa” polygons.
  • Calculate cities density (cities / \(km^2\)) per “Nafa” polygon.
  • Plot the densities with a color scale, as shown in Figure F.2.
Cities density ($1/km^2$) in each "Nafa"

Figure F.2: Cities density (\(1/km^2\)) in each “Nafa”

(50 points)