Skip to content

Instantly share code, notes, and snippets.

View offensivepolitics's full-sized avatar

Jason Holt offensivepolitics

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am offensivepolitics on github.
  • I am jholt (https://keybase.io/jholt) on keybase.
  • I have a public key ASDCPJhcsjMkg9lE4AnBIka_kzJb-pmU6t4Fg-B09qB5Ego

To claim this, I am signing this object:

@offensivepolitics
offensivepolitics / README.md
Last active December 12, 2015 08:49 — forked from tsnow/README.md

Spend 5 literal minutes thinking about:

  • How much time you have to devote to this exercise?
  • How can you verify that your solution is correct?

Then:

  1. Fork this gist and clone it locally.
  2. Send tsnowhite@taximagic.com and aharris@taximagic.com a link to your forked gist, along with an estimate of how long the solution should take in man-hours and an estimate of when you will be finished.
  3. Complete the exercise.
library(maps)
unemp <- read.csv('unemployment09.csv',header=FALSE, stringsAsFactors=FALSE,
col.names=c("blsid", "stfips", "cofips", "name", "year", "pop1", "pop2", "unempraw", "unemppct"))
unemp$mpname <- tolower(paste(state.name[match(sub("^.*([A-Z][A-Z])$","\\1",unemp$name,fixed=FALSE),state.abb)],
sub("^(.*) (County|[Cc]ity|Parish), ..$","\\1", unemp$name),sep=","))
unemp$ri <- as.numeric(cut(unemp$unemppct,c(seq(0,10,by=2),max(unemp$unemppct))))