nyc311
is a R package based on ETL framework to interface with NYC311 Phone call tracking system data. This package contains information collected from NYC Open Data Portal, and it allows users to download multiple years of phone call data to a local SQL database.
NYC Open Data Portal updates NYC311 dataset everyday, so users can get access to phone call information from 2010-01-10 to yesterday. This package uses the ETL framework.
install.packages("devtools")
devtools::install_github("beanumber/nyc311")
This command loads both etl
and dplyr
.
library(nyc311)
calls <- etl("nyc311")
summary(calls)
calls %>%
etl_extract(years = 2010:2011, months = 1:2, num_calls = 100) %>%
etl_transform(years = 2010:2011, months = 1:2) %>%
etl_load(years = 2010:2011, months = 1:2)
Now you can pull the data that you are interested in into your R Environment.
my_calls <- calls %>%
tbl("calls") %>%
collect()
And take a look at it.
glimpse(my_calls)
Please read the vignette for more detailed examples.