Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

munging

  • Loading branch information...
commit b4ffc8e1d80f861c41ad1ef26cf2e0ec4a0f38b4 1 parent b096aa3
@tlevine authored
View
8 analysis/munge/5-group.R
@@ -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))
})
View
1  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
View
1  analysis/munge/8-combine.R
@@ -0,0 +1 @@
+quinoa$yoga.teachers.per.capita <- quinoa$yoga.teachers / quinoa$pop
View
1  analysis/munge/9-present.R
@@ -0,0 +1 @@
+yoga.top.100 <- quinoa[order(quinoa$yoga.teachers.per.capita, decreasing = T),][1:100,]
Please sign in to comment.
Something went wrong with that request. Please try again.