Stretch Exercise for Assignment05 This code executes two seperate analyses. First, it finds the Chicago L train station with the highest number of homicides within 400 meters nearby. Second, it creates a function that takes the year, a variable code, a user chosen title, and state and county fips codes to return a map, by census tract, of the chosen variable with an easily readable title. The images folder contains 6 maps created through iterations with the pmap() function from the purrr package in R. To run the L train station code, users will need to have downloaded the L line station shapefile as well as the Chicago Census tract shapefile and reduced_crimes.csv from Canvas. Place all of these in a data/ folder, and with the correct packages loaded, all of the code will run to display a map of all L stations on top of the Chicago Census tract map, a map of L stations only within the boundary of Chicago, and, finally, counts of homicides within 400 meters of each L line station in Chicago. Pulaski-Congress station has the highest amount of homicides within 400 meters, for the limited crimes dataset analyzed. The remainder of the code creates a function to return mapped census variables. This does not require any outside datasets, but does require a few packages and possibly a census api key. The code contains the progress on the function as well as the iterated data to create the six maps in the images folder. With the function, api_pulls, that is documented by the roxygen skeleton, users can input any acs census variable, state and county fips codes, year, and give the map a name to return a mapping of the variable with an easily read title.
-
Notifications
You must be signed in to change notification settings - Fork 0
BenjaminFReese/stretch01
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Stretch Exercise for Assignment05
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published