LoslegenKostenlos loslegen

Shifting Alaska and Hawaii geometry

Analysts will commonly want to map data for the entire United States by state or county; however, this can be difficult by default as Alaska and Hawaii are distant from the continental United States. A common solution is to rescale and shift Alaska and Hawaii for mapping purposes, which is supported in tidycensus. You'll learn how to do this in this exercise.

Diese Übung ist Teil des Kurses

Analyzing US Census Data in R

Kurs anzeigen

Anleitung zur Übung

  • Use the tidycensus geography argument to request median home value data by state.
  • Use the shift_geo parameter to tell tidycensus to return shifted and re-scaled geometry for Alaska and Hawaii.
  • Plot your new dataset.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Get a dataset of median home values from the 1-year ACS
state_value <- ___(geography = ___, 
                       ___ = "B25077_001", 
                       ___ = "acs1", 
                       geometry = ___, 
                       ___ = TRUE)

# Plot the dataset to view the shifted geometry
___(state_value["estimate"])
Code bearbeiten und ausführen