Code Monkey home page Code Monkey logo

btskinner.github.io's Introduction

Packages

Course/lessons focused on coding/quantitative research

Replication files

Each paper is linked in the repository README or on my webpage (contact me if you need access)

General

btskinner.github.io's People

Contributors

btskinner avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

kem3e

btskinner.github.io's Issues

Merging IPEDS Bug

Hi Ben,

I know we talked about this earlier year, and you said I should submit a bug report for it. I couldn't find a repo for merging ipeds, so I figured I'd submit it here.

With some of the obscure finance datasets that we were using from IPEDS, the file name has 5 digits in it (e.g. F1718_F1A), so when merging ipeds runs the year comes out messed up. So e.g. for F1718_F1A the year ends up coming out as 2172

Original (Lines 79-83)

get year from file name

    year <- as.numeric(gsub("\\D", "", zfiles[i]))
    ## convert split year (e.g., 0910 to 2009)
    if (year < 2000) {
        year <- round(year/100, digits=0) + 2000
    }

The potential fix I came up with is to, instead of deleting everything that is not a digit using gsub, extract the first 4 digits from the file name with str_extract

Potential Fix (Lines 79-83)

get year from file name

year <- as.numeric(str_extract(zfiles[i], "\\d{4}"))
## convert split year (e.g., 0910 to 2009)
if (year < 2000) {
  year <- round(year/100, digits=0) + 2000
}

Hopefully that's useful! I've changed my project script to use this fix (as opposed to the case when we had been using) and it seems to work 🤞

Matt

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.