No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Travis-CI Build Status

title: "Into to the farsRPackageProj"
author: "CJ Muller"
date: 04-29-2018


This is an R Markdown document for the package 'farsRPackageProj'. This is a demenstration of knittr and R markdown 'vignette' in fulfillment of the course objectives for 'Coursera course 'Master Soft Dev in R by Johns Hopkins, course # 3 Building R Packages, week 4'.

Introduction and Description

The file 'fars_functions.R' are a set of 5 functions provided by Coursera to demonstrate how to plot observations for fatalities seen on the US highway system. Data are from the US National Highway Traffic Safety Administration's Fatality Analysis Reporting System, which is a nationwide census providing the American public yearly data regarding fatal injuries suffered in motor vehicle traffic crashes. See:

Functions provided

The following 5 functions are used to plot these datasets on a png state map based on latitude and longitude of the observations:

  1. fars_read(filename) - function to read a semicolon (;) delimited file (including csv, tsv, .gz, .bz2, or .zip) into a tibble, for example:
          filename ="accident_2013.csv.bz2"
  1. make_filename(year) - utility function used by the function'fars_read_years' to create a string to be used as a filename of the format 'accident_(year).csv.bz2', for example:
  1. fars_read_years(year) - function to read the US National Highway Traffic Safety data by individual file year, placing them into a tibble (dataframe), for example:
  1. fars_summarize_years(year) - function to read the US National Highway Traffic Safety data by one or more years and summarize number of observations for each month into a tibble (dataframe) 12 x (number of years specified), for example:
  1. fars_map_state(year) - function to read the US National Highway Traffic Safety data and plot plot the of observations for the given year on a png state map' based on latitude and longitude of the observation, (Alabama = 1, Wyoming = 50, etc), for example:
          fars_map_state(1,2013)  # Alabama
          fars_map_state(12,2014) # Florida

Sample data sets included

The file '' has been included as a smaple data set in the 'data-raw' folder of the package. It contain data for 3 years work of fatalities:

  • accident_2013.csv.bz2
  • accident_2014.csv.bz2
  • accident_2015.csv.bz2