The patch partition is available at Patchwork Nation County Types in Microsoft Excel format. We transform it in CSV format and read it into R. We have to transform it into Pajek's partition and a partition for map drawing.
> setwd("E:/Data/counties/patch") > patch <- read.csv("./patchTypes.csv",header=TRUE,stringsAsFactors=FALSE,sep=";") > names(patch) [1] "fips" "Patchwork.Nation.county.types" [3] "X" > d <- readLines("../pajek/usc3110+.paj")[15:3124] > dd <- unlist(lapply(d,function(x) as.integer(strsplit(x,'\"')[[1]][2]))) > fips <- patch$fips > types <- patch$Patchwork.Nation.county.types > u <- match(dd,fips) > (i <- which(is.na(u))) [1] 303 1620 2888 > nam <- readLines("../pajek/usc3110.nam")[2:3111] > nams <- unlist(lapply(nam,function(x) strsplit(x,'\"')[[1]][2])) > nams[1:10] [1] "Autauga" "Baldwin" "Barbour" "Bibb" "Blount" "Bullock" [7] "Butler" "Calhoun" "Chambers" "Cherokee" > nams[i] [1] "Dade" "Yellowstone National" "Clifton Forge" > dat <- read.csv("./patch.csv",header=TRUE,stringsAsFactors=FALSE,sep=";") > names(dat) [1] "fips" "County.Name" "stabb" "lat" "lon" ........... [156] "service10" "empty10" "military10" "college10" "categories10" > cNam <- dat$County.Name > cFips <- dat$fips > dat[grep("Yellow",cNam),1:5] fips County.Name stabb lat lon 1399 27173 MN_ Yellow Medicine County MN 44,736755 -95,841380 1652 30111 MT_ Yellowstone County MT 45,791792 -108,535700 > dat[grep("Dade",cNam),1:5] fips County.Name stabb lat lon 361 12086 FL_ Miami-Dade County FL 25,780546 -80,295226 426 13083 GA_ Dade County GA 34,886772 -85,495520 1510 29057 MO_ Dade County MO 37,418892 -93,828881 > dat[grep("Alleghany",cNam),1:5] fips County.Name stabb lat lon 1891 37005 NC_ Alleghany County NC 36,495691 -81,106863 2821 51005 VA_ Alleghany County VA 37,795977 -79,965505 > > u[i] <- c(361,1630,2821) > dat[u[i],1:5] fips County.Name stabb lat lon 361 12086 FL_ Miami-Dade County FL 25,780546 -80,295226 1630 30067 MT_ Park County MT 45,599059 -110,575462 2821 51005 VA_ Alleghany County VA 37,795977 -79,965505 > v <- match(fips,dd) > cNam[which(is.na(v))] [1] "AK_ Aleutians East Borough" [2] "AK_ Aleutians West Census Area" ....... [27] "AK_ Yukon-Koyukuk Census Area" [28] "CO_ Broomfield County" [29] "FL_ Miami-Dade County" [30] "HI_ Hawaii County" ....... [34] "HI_ Maui County" > dat[grep("Broomfield",cNam),1:5] fips County.Name stabb lat lon 250 8014 CO_ Broomfield County CO 39,929375 -105,055933
The mapping u establishes (on the basis of their FIPS) the coorespondence between Pajek's counties and Patch counties. Among the Pajek's counties only indices 303, 1620, 2888 haven't the cooresponding county in the Patch list. After some research:
we decided to link them as shown in the table:
USC3110 Patch ind name FIPS ind name FIPS 303 Dade 12025 361 Miami-Dade County FL 12086 1620 Yellowstone National 30113 1630 Park County MT 30067 2888 Clifton Forge 51560 2821 Alleghany County VA 51005 250 Broomfield County CO 8014
The inverse mapping v establishes the correspondence of Patch counties to Pajek counties. There are no links to counties from Alaska (AK) and Hawaii (HI) and to Broomfield County, CO and Miami-Dade County, FL.
The municipality of Broomfield was incorporated in 1961 in the southeastern corner of Boulder County. On November 15, 2001, Broomfield County became the 64th, newest and smallest county of Colorado. http://en.wikipedia.org/wiki/Broomfield,_Colorado
> cPart <- dat$categories10 > clu <- cPart[u] > library(maptools) > gpclibPermit() [1] TRUE > setwd("E:/Data/counties/9nations") > load('pq.Rdata') > USsta <- readShapeSpatial("USA/USA_adm1.shp") # state borders > UScou <- readShapeSpatial("USA/USA_adm2.shp") # county borders > setwd("E:/Data/counties/patch") > cl <- rep(NA,length(UScou$NAME_1)) > for(t in 1:3110) {i <- q[p[t]]; if(!is.na(i)) cl[i] <- clu[t]} > save(u,v,cl,clu,cPart,file="PatchPart.Rdata") > (col <- colors()[c(420, 92, 144, 524, 574, 616, 207, 78, 554, 105, 550, 124)]) [1] "lightpink1" "darkorange2" "gold2" "palevioletred" "seagreen" [6] "steelblue1" "gray54" "darkgoldenrod3" "red2" "darkseagreen3" [11] "purple3" "deepskyblue3" > pdf("UScPatch.pdf",width=11.7,height=8.3,paper="a4r") > plot(UScou,xlim=c(-124,-67),ylim=c(29,45),col=col[cl],bg="skyblue",border="black",lwd=0.03,asp=1.25) > plot(USsta,xlim=c(-124,-67),ylim=c(29,45),lwd=0.1,border="black",add=TRUE,asp=1.25) > # text(coordinates(UScou),labels=as.character(UScou$NAME_2),cex=0.1) > title("Mainland US"); dev.off()
Current colors
ID PN Type 1 Monied Burbs 420 "lightpink1" 2 Minority Central 92 "darkorange2" 3 Evangelical Epicenters 144 "gold2" 4 Tractor County 524 "palevioletred" 5 Campus and Careers 574 "seagreen" 6 Immigration Nation 616 "steelblue1" 7 Industrial Metropolis 207 "gray54" 8 Boom Towns 78 "darkgoldenrod3" 9 Service Worker Centers 554 "red2" 10 Emptying Nests 105 "darkseagreen3" 11 Military Bastions 550 "purple3" 12 Mormon Outposts 124 "deepskyblue3"
We get the picture uscpatch.pdf