Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

aoue

  • Loading branch information...
commit 8fce75790403f1cf9820cfda4645257a3c40a1ab 1 parent eff1be1
Thomas Levine authored
4 analysis/munge/0-rename.R
... ... @@ -1,2 +1,2 @@
1   -yoga <- dumptruck
2   -rm(dumptruck)
  1 +# yoga <- dumptruck
  2 +# rm(dumptruck)
10 analysis/munge/1-male-ratio.R
... ... @@ -0,0 +1,10 @@
  1 +aff$portion.female <- (function(){
  2 + # Dunno what the difference is, so let's take a mean.
  3 + males.per.female <- mean(aff$Males.per.100.females, aff$Males.per.100.females.1)/100
  4 +
  5 + # Then turn it into a proportion
  6 + portion.male <- males.per.female / (males.per.female + 1)
  7 +
  8 + # Return portion female for funzies.
  9 + 1 - portion.male
  10 +})()
2  analysis/munge/3-zip.R
... ... @@ -1,5 +1,5 @@
1 1 get.zip.code <- function(messy.zip) {
2   - sub('[^0-9]*([0-9]{5}).*', '\\1', messey.zip)
  2 + sub('[^0-9]*([0-9]{5}).*', '\\1', messy.zip)
3 3 }
4 4
5 5 # Get the zip code
4 analysis/munge/5-group-and-join.R
... ... @@ -0,0 +1,4 @@
  1 +aff.grouped <- ddply(aff, 'zip', function(df){
  2 + pop <- sum(df$Total.population)
  3 +
  4 +})

0 comments on commit 8fce757

Please sign in to comment.
Something went wrong with that request. Please try again.