# IST 687 Working with map data

2020-02-19 18:27:02

## Todayâ€™s Agenda

• Announcements
• Exam Logistics
• Review up Week 6 - Introduction to data visualization
• Week 7 - Working with map data
• Breakout (Lab 7)
• Homework 7 Tips
• Next weekâ€™s agenda

## Announcements

• Office Hours: after class and by appointment
• HW 6 grades available on LMS
• Upcoming Schedule
• Week 8 (30 min. live session)
• Complete mid-term with 48 hours
• Project Update III in Week 10
• Practice mid-term released after class (SLACK & Syllabus)

# Exam Logistics

## Exam Logistics

• Format
• Closed book/notes/R
• 1 hour time limit (no pausing)
• Materials covered: Weeks 1-8
• Question types
• Given code what is the expected output: 2
• Write code to perform: 10
• Open-ended questions: 9

## Question distribution

Week # Questions
2 - Using R to manipulate data. 8
3 - Descriptive Statistics & Functions 5
4 - Inferential statistics 4
6 - Introduction to visualization 1
7 - Working with map data 1
8 - Linear modeling 2

Exam office hours: Monday, February 24th (Zoom from 5 pm ET - 8 pm ET) and SLACK

# Review: Week 6 - Introduction to data visualization

## Week 6 - Introduction to visualization

• Creating visualizations with `ggplot()â€™
• Components of ggplot: data, aesthetics, geometry
• Plots for data exploration using layers: distributions `geom_histogram()`, boxplots `geom_boxplot()`, line charts `geom_line()`, heatmaps `geom_tile()`

• Adding complexity (information) by manipulating graph aesthetics e.g., `fill =`, `color =`, and `size =` and adjusting axis angles e.g., `theme(axis.text.x=element_text(angle=45, hjust=1))`

## Week 6 - Introduction to visualization

Data carpentry

• Creating R readable dates from incomplete information

`air\$Date <- paste(air\$Month, air\$Day, 1973, sep="/")`

`air\$Date <- as.Date(air\$Date, "%m/%d/%Y"")`

• Handling NAs in the dataset

`air\$Ozone[is.na(air\$Ozone)] <- mean(air\$Ozone, na.rm=TRUE)`

## Week 6 - Introduction to visualization

• Re-formatting data using `melt()` from wide to long format

`dfAir <- data.frame(air\$Ozone, air\$Solar.R, air\$scaleWind, air\$Temp, air\$Date)`

`dfAir <- melt(dfAir, id=c("air.Date"))`

# Week 7 - Working with map data

## Week 7 - Working with map data

• Exploring creating maps and overlaying data on maps.
• Adding complexity to maps e.g., changing colors based on attributes of records.
• Retrieving data from open APIs (e.g., Google/OpenStreetMap)
• Using base datasets in R
• Data munging

## Lab 7 (50 mins.)

New Lab Assignment

• Lab 7
• Google no longer allows API requests without a user account (its where we retrieve lat/long data for maps)

• Objective: Plot ports as points (e.g., airports, train stations) in a city of your choosing using OpenStreetMap data
• Dataset: World Ports

## Lab 7 Output

• Your output should look similar to these maps of the ports in Berlin