Giter Site home page Giter Site logo

crime_data's Introduction

This is a long-term project to collect and clean crime data (primarily FBI crime data) and make it accessible to the public. The code here is mostly to read in the data from the FBI raw files, clean it slightly, and combine years together for a single file.

crime_data's People

Contributors

jacobkap avatar

Stargazers

 avatar

Watchers

 avatar

crime_data's Issues

dupe in fixing butler and clinton ORIs

Hey Jacob,

This is a tremendous resource that you've put online! Both your data outputs and this code has been incredibly helpful in my work—thanks so much for open sourcing it.

I stumbled across the weirdness of the PAPEP00 ori in trying to do some county-level aggregation, which led me to lines 133-139 of R/crosswalk.R. I think in the code below you're attempting to fix Butler's variables twice, rather than fixing Butler and then fixing Clinton.

  # Fix issue where Butler University has wrong county FIPS code
  crosswalk$fips_state_code[crosswalk$ori        == "IN04940"] <- "18"
  crosswalk$fips_county_code[crosswalk$ori       == "IN04940"] <- "097"
  crosswalk$fips_state_county_code[crosswalk$ori == "IN04940"] <- "18097"
  crosswalk$fips_place_code[crosswalk$ori        == "IN04940"] <- "36003"

  # Fix issue where Clinton Tennessee has wrong county FIPS code
  crosswalk$fips_state_code[crosswalk$ori        == "IN04940"] <- "47"
  crosswalk$fips_county_code[crosswalk$ori       == "IN04940"] <- "001"
  crosswalk$fips_state_county_code[crosswalk$ori == "IN04940"] <- "47001"
  crosswalk$fips_place_code[crosswalk$ori        == "IN04940"] <- "15580"

You also later filter out IN04940, so this bit ends up not mattering, but wanted to call this out in case this isn't the desired behavior, if/when you need to reproduce. (I wasn't certain about clinton's ORI, or else I would've submitted a PR).

Hope this helps, & thanks again!

error in setwd - no CleanData folder in the repo

I'm having a hard time installing the package through install_github or even by installing the package from source after directly downloading it, and it seems part of the problem comes from a number of references to a "clean_data" folder that's not in here. Am I missing something?

I kept getting non-zero exit status errors, but I have Rtools and it's properly loaded. I also tried deleting all dependency packages and re-installing them manually. I also was getting a no-staged-install error, so I added StagedInstall: no to the Description file.

I'm using Windows 10, R version 4.0.3. This is the most recent version of the error message.

> install.packages("crime_data-master", repos = NULL, type="source")
Installing package into ‘C:/Users/Andrew/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
* installing *source* package 'crimedata' ...
** using non-staged installation via StagedInstall field
** R
** inst
** byte-compile and prepare package for lazy loading
Downloading GitHub repo jacobkap/asciisetupreader@HEAD

v  checking for file 'C:\Users\Andrew\AppData\Local\Temp\Rtmp4gigrA\remotes2dac5b004a2e\jacobkap-asciiSetupReader-c20e36a/DESCRIPTION' ...
-  preparing 'asciiSetupReader': (1.9s)
v  checking DESCRIPTION meta-information ... 
-  checking for LF line-endings in source and make files and shell scripts
-  checking for empty or unneeded directories
-  building 'asciiSetupReader_2.3.2.tar.gz'
   
Installing package into 'C:/Users/Andrew/Documents/R/win-library/4.0'
(as 'lib' is unspecified)
* installing *source* package 'asciiSetupReader' ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package 'asciiSetupReader'
    finding HTML links ... done
    make_sps_setup                          html  
    parse_setup                             html  
    read_ascii_setup                        html  
    read_ascii_setup_addin                  html  
    sas_ascii_reader                        html  
    spss_ascii_reader                       html  
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
*** arch - i386
*** arch - x64
** testing if installed package can be loaded from final location
*** arch - i386
*** arch - x64
** testing if installed package keeps a record of temporary installation path
* DONE (asciiSetupReader)
Error in setwd(here::here("clean_data/crosswalk")) : 
  cannot change working directory
Error: unable to load R code in package 'crimedata'
Execution halted
ERROR: lazy loading failed for package 'crimedata'
* removing 'C:/Users/Andrew/Documents/R/win-library/4.0/crimedata'
Warning in install.packages :
  installation of package ‘crime_data-master’ had non-zero exit status`

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.