Visualizing immigration

2019-02-11

Visualizing success[a]

The successful city:

  • static
  • high turnover
  • green space
  • low crime

In groups of 4

  1. Come up with a definition of success to apply on the last 20 year
  2. Sketch out an imagined dataset that would allow you to operationalize it.
  3. Look around online: Can you find the data? What’s the closest? Who would have collected it?
    • Note any interesting datasets you find in the process, related or not. These will be the data that you can start to think about using for your visualization project.

Who keeps data on the city?

  • Government.
    • City
    • State
    • Federal – The Census.
  • Media
    • Globe
    • Election results
    • Police shootings

Other sources:

  • NGOs

  • Corporations

  • Libraries and Academics
    • BARI
  • Proxy data (indirect sources)
    • Cell-phone providers and tech companies
    • Remote sensing (e.g. night lights)

Guest: John Wihbey

States by population rank, 1890

Ancestry and ethnic composition, 1890

Composition of the foreign-born population 1890

Political history and supremacy of parties 1880 [b]

Ethnic dot maps

Ethnic dot maps

NYC

NYC

Diversity Explorer

Diversity Explorer

Census Data

RStudio: reload the project from last Monday with ggplot2. Online.)

Change the code to read in the file that you downloaded earlier.

  • read_csv to read comma-separated values.
  • read_tsv for tab-separated values.
  • The package readxl, which you have installed, can read xls and xlsx files from excel.

Visualize it using ggplot2.

Consider geoms:

  1. A bar plot (geom_bar)
  2. A line chart (geom_line)
  3. A boxplot (geom_boxplot)
  4. A scatterplot (geom_point)
  5. A histogram (geom_histogram)

Consider using aesthetic mappings

  1. color (color for points and lines, fill for areas)
  2. size (with geom_point)
  3. text (with geom_text)

Practicum: Visualizing data in ggplot2

Take one of the CSVs you downloaded before the break.