Code Monkey home page Code Monkey logo

apd-crime-data's Introduction

civictechatlanta

Civic Tech Atlanta's main website

Getting Started

You need to be in the directory that contains the docker-compose.yml file

Run the following command in a terminal:

docker compose up -d 

This should be all you need to get the project up and running

apd-crime-data's People

Contributors

bbrewington avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apd-crime-data's Issues

Make Work for RSocrata

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.

apd-crime-data.R `bind_rows()` broken

> bind_rows(crime_data)
Error: Can't combine `..1$beat` <integer> and `..2$beat` <character>.

crime_data is now a list of 4 data frames with different names and columns, which breaks bind_rows:

>   lapply(X = crime_data,FUN = names)
[[1]]
 [1] "offense_id"    "rpt_date"      "occur_date"    "occur_day"     "occur_day_num"
 [6] "occur_time"    "poss_date"     "poss_time"     "beat"          "zone"         
[11] "location"      "ibr_code"      "UC2_Literal"   "neighborhood"  "npu"          
[16] "lat"           "long"         

[[2]]
 [1] "offense_id"        "rpt_date"          "occur_date"        "occur_time"       
 [5] "poss_date"         "poss_time"         "beat"              "apt_office_prefix"
 [9] "apt_office_num"    "location"          "MinOfucr"          "dispo_code"       
[13] "Shift"             "loc_type"          "UC2_Literal"       "ibr_code"         
[17] "neighborhood"      "npu"               "long"              "lat"              

[[3]]
 [1] "offense_id"              "rpt_date"                "occur_date"             
 [4] "occur_time"              "poss_date"               "poss_time"              
 [7] "beat"                    "apartment_office_prefix" "apartment_number"       
[10] "location"                "watch"                   "location_type"          
[13] "UC2_Literal"             "UCR_Number"              "neighborhood"           
[16] "npu"                     "lat"                     "long"                   

[[4]]
 [1] "Report.Number"           "Report.Date"             "Occur.Date"             
 [4] "Occur.Time"              "Possible.Date"           "Possible.Time"          
 [7] "Beat"                    "Apartment.Office.Prefix" "Apartment.Number"       
[10] "Location"                "Shift.Occurence"         "Location.Type"          
[13] "UCR.Literal"             "UCR.."                   "IBR.Code"               
[16] "Neighborhood"            "NPU"                     "Latitude"               
[19] "Longitude"     

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.