7. R Maps for visualizing Spatial Information

Topics and Notes
  1. Various R Interactive Map Libraries HTML RMD SOURCE
    • a. Basic types of maps: choropleth and scatter map
    • b. R map libraries
    • c. Choropleth map for aggregated data
    • d. Scatter map for individual-level data
Assignments
  1. Choose an appropriate R map library to create an interactive map of the gas station data and show some information of each gas station on the map using hover/popups.
    • a. Gas Station Data Set DATA SET
    • b. Take a random sample 500 gas stations from the US to plot on the map
    • c. The information to be included in the hover/popups: State, county, address and the zip code.
  2. Philly Crime Data (2015-2024)[link]: This is longitudinal data that contains crime cases since 2015. Use this data to do the following:
    • a. o a. Use appropriate R string functions to extract information of year from the variable date and then add the new variable year to the data set.
    • b. Create a subset containing only 2023 data.
    • c. Choose a map library to make an interactive map to plot crime locations and use different colors to label fatal and non-fatal crimes.
    • d. Add relevant information such as title and annotations to the map.
    • e. Include other important information in the hover message box.
    Assignment Due: Wednesday, 11:30 PM

Copyright © 2019- C. Peng. Last updated: