knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

Travis build status

LPfars is a package that was built for the purposes of the Coursera course Building R Packages

LPfars

The goal of LPfars is to read and summarise the monthly injuries, and plot the density of fatal injuries on a map

Installation

You can install the released version of LPfars from Github with:

devtools::install_github("lefkiospaikousis/LPfars")

Example

The fars_summarize_years returns a summary table with the number of monthly accident cases (row) and the defined year(s) (column). Here the input parameter canbe a numeric vector or a list of the year values.

library(LPfars)

# Set the working directory to the location of the files
# This is for demontrating purposes. Once you have your datasets in your current working directory, you will not have to do this

files_location = system.file("extdata", package = "LPfars")

setwd(files_location)

fars_summarize_years(2013:2015)

Notes

The package re-exports the %>% operator from the package magritrr so you can perfom exploratory analysis the tidyverse way!

What is the FARS

The Fatality Analysis Reporting System (FARS) contains data derived from a US nationwide census regarding fatal injuries suffered in motor vehicle traffic crashes

See here on how to create datasets and use the package

Example Data

You can find the location of the example csv files on your disk by typing

system.file("extdata", package = "LPfars")

Also, you can get the file name of the an example data by typing

system.file("extdata", "accident_2013.csv.bz2", package = "LPfars")

Package Functions

The LPfars package has five functions:



lefkiospaikousis/LPfars documentation built on June 7, 2019, 12:55 a.m.