You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Get and clean Atlanta Police Department Data get.apd.data <- function(selector.text, save.location){ require(rvest) require(dplyr) temp <- tempfile() download.file( read_html("http://www.atlantapd.org/crimedatadownloads.aspx") %>% html_nodes(selector.text) %>% html_attr("href") %>% paste0("http://www.atlantapd.org/", .), destfile = temp) # Save filename of csv crime data raw file, for later use crime.data.filename <- unzip(temp, list = TRUE)$Name # Unzip crime data to "data" folder and close temp file placeholder unzip(temp, exdir = save.location) unlink(temp) crime.data.filename
Was there a reason why you did it this way instead of using SODA? Other PD's could definitely take advantage of this if it was using RSocrata from Chicago.
The text was updated successfully, but these errors were encountered:
Good point. That will probably be the best route; I think we need to clean up the data in Socrata, though. Looks like there's a difference starting in 2015:
Get and clean Atlanta Police Department Data get.apd.data <- function(selector.text, save.location){ require(rvest) require(dplyr) temp <- tempfile() download.file( read_html("http://www.atlantapd.org/crimedatadownloads.aspx") %>% html_nodes(selector.text) %>% html_attr("href") %>% paste0("http://www.atlantapd.org/", .), destfile = temp) # Save filename of csv crime data raw file, for later use crime.data.filename <- unzip(temp, list = TRUE)$Name # Unzip crime data to "data" folder and close temp file placeholder unzip(temp, exdir = save.location) unlink(temp) crime.data.filename
Was there a reason why you did it this way instead of using SODA? Other PD's could definitely take advantage of this if it was using RSocrata from Chicago.
The text was updated successfully, but these errors were encountered: