fars_read_years: Generate a table identifying the month of each datapoint

Description Usage Arguments Details Value Examples

View source: R/fars_functions.R

Description

This function uses the mutate and select functions from the dplyr package to strip the full data frame associated with a given year, leaving only the rows associated with months and the year. This provides a matrix of the number of rows of data from a given year, and columns of months, expressed as an integer from 1 to 12, and the year. If a year for which data is not available is input, function alerts user that it is an invalid year.

Usage

1

Arguments

years

An integer representing a year that is 2013, 2014, or 2015

Details

makes use of the make_filename and fars_read functions by generating a filename based on the year provided, and then generating a data frame from the data associated with that year's datafile

Value

A table with the same number of rows as the data file associated with the year being evaluated, identifying the month associated with each datapoint

Examples

1
2
3
4
5
6
## Not run: 
fars_read_years(2013)
fars_read_years(2014)
fars_read_years(2015)

## End(Not run)

MikePJones/Week4Proj documentation built on May 17, 2019, 2:46 p.m.