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'.
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: http://www.nhtsa.gov/Data/Fatality-Analysis-Reporting-System-(FARS)
The following 5 functions are used to plot these datasets on a png state map based on latitude and longitude of the observations:
filename ="accident_2013.csv.bz2"
fars_read(filename)
make_filename(99)
fars_read_years(2013)
fars_read_years(c(2013:2015))
fars_summarize_years(2013)
fars_summarize_years(c(2013:2015))
fars_map_state(1,2013) # Alabama
fars_map_state(12,2014) # Florida
The file 'fars_data.zip' 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:
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.