fars_summarize_years: Summarize fars record by year

Description Usage Arguments Value Note Examples

Description

Compute the number of records are present for fars for each year (columns) and month (rows).

Usage

1
fars_summarize_years(years, path = ".")

Arguments

years

(num) An integer vector of years (or an object cohercible to it) containing the years of fars files of interest.

path

(chr) path to the fars file

Value

A data frame with a number of column equals to the number of (valid) years passed as input (plus one for the months) and one row each month included in the corresponding fars files. The data frame is filled with the number of records included for the corresponding year and month.

Note

If a year not present in the data is provided, a warning is returned and no column is created for it.

Examples

1
2
3
4
5
6
7
8
## Not run: 
   file_path <- system.file("tests", "testthat", package = "weektwo")

   fars_summarize_years(c(2013, 2014), path = file_path)

   fars_summarize_years(c(2012, 2013, 2014), path = file_path)

## End(Not run)

CorradoLanera/weektwo documentation built on May 8, 2019, 12:51 p.m.