Skip to content

Instantly share code, notes, and snippets.

@obrl-soil
Last active April 29, 2019 05:44
Show Gist options
  • Save obrl-soil/52c3818f89c81b3f3041d7daa230f3bc to your computer and use it in GitHub Desktop.
Save obrl-soil/52c3818f89c81b3f3041d7daa230f3bc to your computer and use it in GitHub Desktop.
population data for `nc`, `sf`'s demo polygon dataset (map of North Carolina's counties)
# datapasta'd http://worldpopulationreview.com/us-counties/nc/
#library(datapasta)
#df_paste()
nc_pop <- data.frame(stringsAsFactors=FALSE,
V1 = c("Mecklenburg County", "Wake County", "Guilford County",
"Forsyth County", "Cumberland County", "Durham County",
"Buncombe County", "Union County", "New Hanover County",
"Gaston County", "Cabarrus County", "Johnston County", "Onslow County",
"Pitt County", "Iredell County", "Davidson County",
"Alamance County", "Catawba County", "Orange County", "Randolph County",
"Rowan County", "Harnett County", "Robeson County", "Brunswick County",
"Wayne County", "Henderson County", "Craven County",
"Cleveland County", "Moore County", "Nash County", "Rockingham County",
"Burke County", "Lincoln County", "Caldwell County",
"Wilson County", "Surry County", "Chatham County", "Carteret County",
"Wilkes County", "Rutherford County", "Franklin County",
"Sampson County", "Stanly County", "Haywood County", "Pender County",
"Lee County", "Granville County", "Duplin County", "Lenoir County",
"Columbus County", "Watauga County", "Hoke County",
"Edgecombe County", "Halifax County", "Beaufort County", "Stokes County",
"McDowell County", "Richmond County", "Vance County", "Jackson County",
"Davie County", "Pasquotank County", "Person County",
"Yadkin County", "Alexander County", "Dare County", "Scotland County",
"Macon County", "Transylvania County", "Bladen County",
"Cherokee County", "Montgomery County", "Ashe County", "Currituck County",
"Anson County", "Hertford County", "Martin County",
"Caswell County", "Madison County", "Greene County", "Polk County",
"Warren County", "Northampton County", "Bertie County",
"Yancey County", "Avery County", "Mitchell County", "Swain County",
"Chowan County", "Perquimans County", "Pamlico County",
"Washington County", "Gates County", "Clay County", "Alleghany County",
"Camden County", "Jones County", "Graham County", "Hyde County",
"Tyrrell County"),
V2 = c(1076837, 1072203, 526953, 376320, 332546, 311640, 257607,
231366, 227198, 220182, 206872, 196708, 193893, 179042,
175711, 165466, 162391, 157974, 144946, 143282, 140644, 132754,
132606, 130897, 124172, 115708, 102578, 97334, 97264, 93991, 90949,
89293, 82403, 81981, 81671, 72224, 71472, 68881, 68576, 66551,
66168, 63430, 61482, 61084, 60958, 60430, 59557, 59039, 56883,
55936, 55121, 54116, 52747, 51310, 47088, 45717, 45159, 44798,
44211, 42973, 42456, 39743, 39370, 37774, 37286, 36099, 35093, 34732,
33956, 33478, 28087, 27435, 26957, 26331, 24991, 23906, 22789,
22646, 21746, 21015, 20558, 19883, 19862, 19224, 17744, 17536,
15072, 14294, 14105, 13474, 12689, 12012, 11544, 11074, 11031,
10581, 9597, 8541, 5363, 4052),
V3 = c("16.64%", "18.23%", "7.64%", "7.09%", "1.63%", "14.86%",
"7.91%", "14.47%", "11.76%", "6.82%", "15.87%", "15.93%",
"3.75%", "6.04%", "9.97%", "1.60%", "7.20%", "2.07%", "8.21%",
"0.92%", "1.66%", "14.68%", "-1.41%", "21.12%", "1.06%", "8.26%",
"-1.53%", "-0.60%", "9.79%", "-1.87%", "-2.89%", "-1.42%", "5.53%",
"-1.24%", "0.46%", "-2.10%", "11.94%", "3.27%", "-0.99%",
"-1.75%", "8.78%", "-0.16%", "1.49%", "3.64%", "16.29%", "4.38%",
"3.29%", "0.66%", "-4.40%", "-3.51%", "8.14%", "13.94%", "-6.85%",
"-5.82%", "-1.49%", "-3.45%", "0.14%", "-3.92%", "-2.41%",
"6.45%", "2.91%", "-2.18%", "-0.09%", "-1.72%", "0.12%", "6.22%",
"-2.68%", "2.31%", "2.64%", "-4.88%", "2.40%", "-1.07%", "-1.01%",
"11.22%", "-6.93%", "-3.45%", "-6.98%", "-4.72%", "4.63%",
"-1.20%", "0.38%", "-5.22%", "-9.86%", "-9.53%", "-0.34%", "-1.27%",
"-2.82%", "2.04%", "-4.29%", "-0.05%", "-3.22%", "-8.58%",
"-5.12%", "4.39%", "-0.99%", "5.71%", "-5.36%", "-3.71%", "-7.74%",
"-8.22%")
)
names(nc_pop) <- c('County', 'Population_2019', 'change_v_2010')
nc_pop$County <- gsub(' County', '', nc_pop$County)
nc_pop$change_v_2010 <- gsub('\\%$', '', nc_pop$change_v_2010)
nc_pop$change_v_2010<- as.numeric(nc_pop$change_v_2010 )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment