{"action":"created","comment":{"url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/pulls/comments/60611126","id":60611126,"diff_hunk":"@@ -92,30 +97,58 @@ trick that allows you to have different `data` and different `aes` apply to\n different `geom`'s; in this case state-level vs county-level data.\n \n ```{r}\n+\n+pgore <- as.numeric(as.character(COUNTY$PGORE))\n+pnader <- as.numeric(as.character(COUNTY$PNADER))\n+COUNTY$PBUSH <- as.numeric(as.character(COUNTY$PBUSH))\n+\n+st_co <- COUNTY %>% \n+  mutate(PGO_NA = pgore + pnader) %>% \n+  mutate(state = clean_text(STATE)) %>% \n+  mutate(county = clean_text(COUNTY))\n+\n+st_co <- st_co %>% \n+  mutate(state = str_replace_all(state, fixed(\" \"),\"\")) %>% \n+  mutate(county = str_replace_all(county, fixed(\" \"),\"\")) %>% \n+  select(state, county, PBUSH, PGO_NA)\n+\n+US_county <- US_county %>% \n+  mutate(region = str_replace_all(region, fixed(\" \"),\"\")) %>% \n+  mutate(subregion = str_replace_all(subregion, fixed(\" \"),\"\"))\n+  \n+\n+stco_coor <- right_join(US_county, st_co, \n+                        by = c(\"region\" = \"state\", \"subregion\" = \"county\"))\n+\n+\n ggplot(data=NULL) +\n   geom_polygon(data=US_county, aes(x=long, y=lat, group=group, fill=1)) +\n   geom_path(data=US_county, aes(x=long, y=lat, group=group), col=\"black\", size=0.05) +\n   geom_path(data=US_state, aes(x=long, y=lat, group=group), col=\"black\", size=0.1) +\n-  coord_map()\n+  geom_polygon(data = stco_coor, aes(x=long, y=lat, group=group, fill = PBUSH)) +\n+  coord_map() +\n+  scale_fill_gradientn(name=\"Election Result\", \n+                       colours = c(\"#261758\", \"white\", \"#801515\"),\n+                       values = (c(0,0.499, 0.5, 0.5001, 1.0)))\n+\n ```\n \n \n ### Write-Up\n-\n+As you can see from this map, the coasts prodominately voted democrat. The\n+counties that voted for Bush are seen to be in the middle of the country. This\n+also follows city lines. The counties with large cities (also the smaller of \n+counties) voted democratic, while the more rural, larger counties, voted for\n+Bush. ","path":"HW-4.Rmd","position":95,"original_position":95,"commit_id":"9486e5b7679952e754db13ba903f0a94990e63d5","original_commit_id":"9486e5b7679952e754db13ba903f0a94990e63d5","user":{"login":"rudeboybert","id":4574203,"avatar_url":"https://avatars.githubusercontent.com/u/4574203?v=3","gravatar_id":"","url":"https://api.github.com/users/rudeboybert","html_url":"https://github.com/rudeboybert","followers_url":"https://api.github.com/users/rudeboybert/followers","following_url":"https://api.github.com/users/rudeboybert/following{/other_user}","gists_url":"https://api.github.com/users/rudeboybert/gists{/gist_id}","starred_url":"https://api.github.com/users/rudeboybert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rudeboybert/subscriptions","organizations_url":"https://api.github.com/users/rudeboybert/orgs","repos_url":"https://api.github.com/users/rudeboybert/repos","events_url":"https://api.github.com/users/rudeboybert/events{/privacy}","received_events_url":"https://api.github.com/users/rudeboybert/received_events","type":"User","site_admin":false},"body":"Don't forget the second part of the question.","created_at":"2016-04-21T16:16:12Z","updated_at":"2016-04-21T16:16:12Z","html_url":"https://github.com/Middlebury-Data-Science/HW-4/pull/5#discussion_r60611126","pull_request_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/pulls/comments/60611126"},"html":{"href":"https://github.com/Middlebury-Data-Science/HW-4/pull/5#discussion_r60611126"},"pull_request":{"href":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/pulls/5","id":67299477,"html_url":"https://github.com/Middlebury-Data-Science/HW-4/pull/5","diff_url":"https://github.com/Middlebury-Data-Science/HW-4/pull/5.diff","patch_url":"https://github.com/Middlebury-Data-Science/HW-4/pull/5.patch","issue_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/issues/5","number":5,"state":"open","locked":false,"title":"Homework 4- First Submission (Updated)","user":{"login":"amholtz","id":17280223,"avatar_url":"https://avatars.githubusercontent.com/u/17280223?v=3","gravatar_id":"","url":"https://api.github.com/users/amholtz","html_url":"https://github.com/amholtz","followers_url":"https://api.github.com/users/amholtz/followers","following_url":"https://api.github.com/users/amholtz/following{/other_user}","gists_url":"https://api.github.com/users/amholtz/gists{/gist_id}","starred_url":"https://api.github.com/users/amholtz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amholtz/subscriptions","organizations_url":"https://api.github.com/users/amholtz/orgs","repos_url":"https://api.github.com/users/amholtz/repos","events_url":"https://api.github.com/users/amholtz/events{/privacy}","received_events_url":"https://api.github.com/users/amholtz/received_events","type":"User","site_admin":false},"body":"Please look at the second committed file. The one that says \"This is my first submission for homework 4\", and not \"Hi! This is my first submission for homework #4\". In other words, commit, fce0065 and not 14c4f2b. I tried deleting the original commit, but I can't. The up-to-date commit is compatible with the data folder\r\n\r\nThank you and sorry for the confusion. ","created_at":"2016-04-21T05:38:01Z","updated_at":"2016-04-21T16:16:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"28b1ceae23966777aedf0ae40b94fa21c935fc8d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/pulls/5/commits","review_comments_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/pulls/5/comments","review_comment_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/issues/5/comments","statuses_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/statuses/9486e5b7679952e754db13ba903f0a94990e63d5","head":{"label":"amholtz:master","ref":"master","sha":"9486e5b7679952e754db13ba903f0a94990e63d5","user":{"login":"amholtz","id":17280223,"avatar_url":"https://avatars.githubusercontent.com/u/17280223?v=3","gravatar_id":"","url":"https://api.github.com/users/amholtz","html_url":"https://github.com/amholtz","followers_url":"https://api.github.com/users/amholtz/followers","following_url":"https://api.github.com/users/amholtz/following{/other_user}","gists_url":"https://api.github.com/users/amholtz/gists{/gist_id}","starred_url":"https://api.github.com/users/amholtz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amholtz/subscriptions","organizations_url":"https://api.github.com/users/amholtz/orgs","repos_url":"https://api.github.com/users/amholtz/repos","events_url":"https://api.github.com/users/amholtz/events{/privacy}","received_events_url":"https://api.github.com/users/amholtz/received_events","type":"User","site_admin":false},"repo":{"id":56164416,"name":"HW-4","full_name":"amholtz/HW-4","owner":{"login":"amholtz","id":17280223,"avatar_url":"https://avatars.githubusercontent.com/u/17280223?v=3","gravatar_id":"","url":"https://api.github.com/users/amholtz","html_url":"https://github.com/amholtz","followers_url":"https://api.github.com/users/amholtz/followers","following_url":"https://api.github.com/users/amholtz/following{/other_user}","gists_url":"https://api.github.com/users/amholtz/gists{/gist_id}","starred_url":"https://api.github.com/users/amholtz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amholtz/subscriptions","organizations_url":"https://api.github.com/users/amholtz/orgs","repos_url":"https://api.github.com/users/amholtz/repos","events_url":"https://api.github.com/users/amholtz/events{/privacy}","received_events_url":"https://api.github.com/users/amholtz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/amholtz/HW-4","description":"GIS/Shapefiles, Census Data, Leaflet Interactive Maps, and Shiny Interactive Apps.","fork":true,"url":"https://api.github.com/repos/amholtz/HW-4","forks_url":"https://api.github.com/repos/amholtz/HW-4/forks","keys_url":"https://api.github.com/repos/amholtz/HW-4/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amholtz/HW-4/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amholtz/HW-4/teams","hooks_url":"https://api.github.com/repos/amholtz/HW-4/hooks","issue_events_url":"https://api.github.com/repos/amholtz/HW-4/issues/events{/number}","events_url":"https://api.github.com/repos/amholtz/HW-4/events","assignees_url":"https://api.github.com/repos/amholtz/HW-4/assignees{/user}","branches_url":"https://api.github.com/repos/amholtz/HW-4/branches{/branch}","tags_url":"https://api.github.com/repos/amholtz/HW-4/tags","blobs_url":"https://api.github.com/repos/amholtz/HW-4/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amholtz/HW-4/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amholtz/HW-4/git/refs{/sha}","trees_url":"https://api.github.com/repos/amholtz/HW-4/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amholtz/HW-4/statuses/{sha}","languages_url":"https://api.github.com/repos/amholtz/HW-4/languages","stargazers_url":"https://api.github.com/repos/amholtz/HW-4/stargazers","contributors_url":"https://api.github.com/repos/amholtz/HW-4/contributors","subscribers_url":"https://api.github.com/repos/amholtz/HW-4/subscribers","subscription_url":"https://api.github.com/repos/amholtz/HW-4/subscription","commits_url":"https://api.github.com/repos/amholtz/HW-4/commits{/sha}","git_commits_url":"https://api.github.com/repos/amholtz/HW-4/git/commits{/sha}","comments_url":"https://api.github.com/repos/amholtz/HW-4/comments{/number}","issue_comment_url":"https://api.github.com/repos/amholtz/HW-4/issues/comments{/number}","contents_url":"https://api.github.com/repos/amholtz/HW-4/contents/{+path}","compare_url":"https://api.github.com/repos/amholtz/HW-4/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amholtz/HW-4/merges","archive_url":"https://api.github.com/repos/amholtz/HW-4/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amholtz/HW-4/downloads","issues_url":"https://api.github.com/repos/amholtz/HW-4/issues{/number}","pulls_url":"https://api.github.com/repos/amholtz/HW-4/pulls{/number}","milestones_url":"https://api.github.com/repos/amholtz/HW-4/milestones{/number}","notifications_url":"https://api.github.com/repos/amholtz/HW-4/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amholtz/HW-4/labels{/name}","releases_url":"https://api.github.com/repos/amholtz/HW-4/releases{/id}","deployments_url":"https://api.github.com/repos/amholtz/HW-4/deployments","created_at":"2016-04-13T15:35:53Z","updated_at":"2016-04-13T15:02:15Z","pushed_at":"2016-04-21T15:38:23Z","git_url":"git://github.com/amholtz/HW-4.git","ssh_url":"git@github.com:amholtz/HW-4.git","clone_url":"https://github.com/amholtz/HW-4.git","svn_url":"https://github.com/amholtz/HW-4","homepage":"","size":746,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Middlebury-Data-Science:master","ref":"master","sha":"de66fa03d5a39676a076037acfcdce8af091a5e9","user":{"login":"Middlebury-Data-Science","id":15661362,"avatar_url":"https://avatars.githubusercontent.com/u/15661362?v=3","gravatar_id":"","url":"https://api.github.com/users/Middlebury-Data-Science","html_url":"https://github.com/Middlebury-Data-Science","followers_url":"https://api.github.com/users/Middlebury-Data-Science/followers","following_url":"https://api.github.com/users/Middlebury-Data-Science/following{/other_user}","gists_url":"https://api.github.com/users/Middlebury-Data-Science/gists{/gist_id}","starred_url":"https://api.github.com/users/Middlebury-Data-Science/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Middlebury-Data-Science/subscriptions","organizations_url":"https://api.github.com/users/Middlebury-Data-Science/orgs","repos_url":"https://api.github.com/users/Middlebury-Data-Science/repos","events_url":"https://api.github.com/users/Middlebury-Data-Science/events{/privacy}","received_events_url":"https://api.github.com/users/Middlebury-Data-Science/received_events","type":"Organization","site_admin":false},"repo":{"id":56108463,"name":"HW-4","full_name":"Middlebury-Data-Science/HW-4","owner":{"login":"Middlebury-Data-Science","id":15661362,"avatar_url":"https://avatars.githubusercontent.com/u/15661362?v=3","gravatar_id":"","url":"https://api.github.com/users/Middlebury-Data-Science","html_url":"https://github.com/Middlebury-Data-Science","followers_url":"https://api.github.com/users/Middlebury-Data-Science/followers","following_url":"https://api.github.com/users/Middlebury-Data-Science/following{/other_user}","gists_url":"https://api.github.com/users/Middlebury-Data-Science/gists{/gist_id}","starred_url":"https://api.github.com/users/Middlebury-Data-Science/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Middlebury-Data-Science/subscriptions","organizations_url":"https://api.github.com/users/Middlebury-Data-Science/orgs","repos_url":"https://api.github.com/users/Middlebury-Data-Science/repos","events_url":"https://api.github.com/users/Middlebury-Data-Science/events{/privacy}","received_events_url":"https://api.github.com/users/Middlebury-Data-Science/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Middlebury-Data-Science/HW-4","description":"GIS/Shapefiles, Census Data, Leaflet Interactive Maps, and Shiny Interactive Apps.","fork":false,"url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4","forks_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/forks","keys_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/teams","hooks_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/hooks","issue_events_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/issues/events{/number}","events_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/events","assignees_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/assignees{/user}","branches_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/branches{/branch}","tags_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/tags","blobs_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/git/refs{/sha}","trees_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/statuses/{sha}","languages_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/languages","stargazers_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/stargazers","contributors_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/contributors","subscribers_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/subscribers","subscription_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/subscription","commits_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/commits{/sha}","git_commits_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/git/commits{/sha}","comments_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/comments{/number}","issue_comment_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/issues/comments{/number}","contents_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/contents/{+path}","compare_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/merges","archive_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/downloads","issues_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/issues{/number}","pulls_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/pulls{/number}","milestones_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/milestones{/number}","notifications_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/labels{/name}","releases_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/releases{/id}","deployments_url":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/deployments","created_at":"2016-04-13T00:41:49Z","updated_at":"2016-04-13T15:02:15Z","pushed_at":"2016-04-21T15:38:23Z","git_url":"git://github.com/Middlebury-Data-Science/HW-4.git","ssh_url":"git@github.com:Middlebury-Data-Science/HW-4.git","clone_url":"https://github.com/Middlebury-Data-Science/HW-4.git","svn_url":"https://github.com/Middlebury-Data-Science/HW-4","homepage":"","size":626,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":4,"forks":8,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/pulls/5"},"html":{"href":"https://github.com/Middlebury-Data-Science/HW-4/pull/5"},"issue":{"href":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/issues/5"},"comments":{"href":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/Middlebury-Data-Science/HW-4/statuses/9486e5b7679952e754db13ba903f0a94990e63d5"}}}}