Skip to content

Commit

Permalink
munging
Browse files Browse the repository at this point in the history
  • Loading branch information
tlevine committed Sep 20, 2012
1 parent b096aa3 commit b4ffc8e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
8 changes: 1 addition & 7 deletions analysis/munge/5-group.R
Expand Up @@ -17,11 +17,5 @@ aff.grouped <- ddply(aff, 'zip', function(df){
})

yoga.grouped <- ddply(yoga, 'zip', function(df){
yoga.teachers <- nrow(df)

if (is.na(yoga.teachers)) {
0
} else {
yoga.teachers
}
c(yoga.teachers = nrow(df))
})
1 change: 1 addition & 0 deletions analysis/munge/7-join.R
@@ -1 +1,2 @@
quinoa <- join(aff.grouped, yoga.grouped, by = 'zip')
quinoa$yoga.teachers[is.na(quinoa$yoga.teachers)] <- 0
1 change: 1 addition & 0 deletions analysis/munge/8-combine.R
@@ -0,0 +1 @@
quinoa$yoga.teachers.per.capita <- quinoa$yoga.teachers / quinoa$pop
1 change: 1 addition & 0 deletions analysis/munge/9-present.R
@@ -0,0 +1 @@
yoga.top.100 <- quinoa[order(quinoa$yoga.teachers.per.capita, decreasing = T),][1:100,]

0 comments on commit b4ffc8e

Please sign in to comment.