Git Product home page Git Product logo

cfa-violations's Introduction

CfA Fellowship 2016 - Technical Question

This is the repository and source code for the technical component of the Code for America Fellowship application.

Language: R (useful for working with datasets to generate quick data)

Presentation format: Markdown table (can also easily output HTML, LaTeX)

####The Prompt Write a program to summarize a simple dataset (a comma-delimited CSV data file). Calculate the number of violations in each category, and the earliest and latest violation date for each category.

Why R? Why Markdown?

R is used widely in statistical computing and data science. While I could have written this in other languages (likely utilizing a CSV parser or implementing my own), I knew R would be capable of quickly reading the data and analyzing subsets of the data.

Because the question wanted a summary of the dataset, R seemed the most efficient choice. If the question also asked for a web interface or other details, then other tools could have been more suitable.

I chose a Markdown table as the presentation format because I wanted the data to be an easily legible table on github, where I am posting the source code. The knitr reporting package allows for multiple types of output formats, including HTML tables, and LaTeX.

Requirements

Running the script

  1. Install R
  2. Install the knitr package in R console (will also install dependencies): install.packages("knitr")
  3. Clone/download this entire repo (including CSV data file)
  4. Navigate to it's directory in the command line
  5. Run Rscript summary.R
  6. Open "data.md" to view results! :)

cfa-violations's People

Contributors

payousefi avatar

Watchers

 avatar  avatar

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.