---
title: 'Network Analysis - Homework #2'
author: "Your Name"
date: ""
output: html_document
editor_options: 
  chunk_output_type: console
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(igraph)
library(tidyverse)
library(stringr)
library(RColorBrewer)

```



This assignment is based on the [2014 VAST Challenge](https://chat.openai.com/c/70a9ac53-4372-4c4d-a390-ee636c766bc3). 

## Background: The Kronos Incident

NOTE: This scenario and all the people, places, groups, and technologies contained therein are fictious. Any resemblance to real people, places, groups, or technologies is purely coincidental.

In the roughly twenty years that Tethys-based GAStech has been operating a natural gas production site in the island country of Kronos, it has produced remarkable profits and developed strong relationships with the government of Kronos. However, GAStech has not been as successful in demonstrating environmental stewardship. 

In January, 2014, the leaders of GAStech are celebrating their new-found fortune as a result of the initial public offering of their very successful company. In the midst of this celebration, several employees of GAStech go missing.  An organization known as the Protectors of Kronos (POK) is suspected in the disappearance, but things may not be what they seem. 

As an expert in visual analytics, you are called in to help law enforcement from Kronos and Tethys assess the situation and figure out where the missing employees are and how to get them home again.  Time is of the essence.

At your disposal, your have a spreadsheet of GPS tracking data of GAStech company cars, `gps_car.csv`, map data for the city of Abila, `Abila_map_data.csv`, and data on employee's credit card transactions, `cc_data.csv.`

You are being counted on to bring law enforcement up to date on the current organization of the POK and how that organization has changed over time, as well as to characterize the events surrounding the disappearance.


1. Please replace "Your Name" in the YAML (top of this script) with your name.


2. In a new code chunk (use (`Ctrl+Alt+I`) to start a new code chunk), load the `Abila_map_data.csv` and make a map of the city. 


3. Load the GPS tracking data for the company cars and add it to the city map:


4. Your goal is to describe the favorite stores and restaurants of a typical GASTech employee. Select one employee (coordinate with your classmates to select different people). Use the credit card data and the GPS data to plot their movement throughout the day. There are many ways to do this, from manually copying and pasting the relevant coordinates to figuring out a way to merge the gps and credit card data. 

Bonus points if you figure out a way to add their home and/or work addresses to the map.


5. Describe a day in the life of this employee. Where do they usually eat breakfast. Where do they go after that? When and where do they have lunch and dinner? Are there any suspicious credit card transactions they made? Is there anything suspicious about their driving routes? Prepare to discuss this in class with your visualization on the projector.

Bonus: Do they meet anyone for any of the meals?


6. Knit the RMarkdown file (press the "Knit" button above) and read through the corresponding html file.  


For the submission: submit your solution in an R Markdown file and (just for insurance) submit the corresponding html file with it. 
