fars_summarize_years: Summarse data by year

Description Usage Arguments Details Value Note Examples

View source: R/fars_functions.R

Description

fars_summarize_years takes a list of years and reads them in using the fars_read_years it then binds these dataframes together and summarises the data.

Usage

1

Arguments

years

The years to read in and summarise

Details

The function will take in a vector of years and read in the data using the fars_summarize_years function, it then binds these rows together and groups by the year and MONTH column creating a count column: n. The data is then converted from a long format to a wide format using the spread function in tidyr.

Value

a data.frame of summarised data which is converted to a wide format

Note

This functions depends on the bind_rows, group_by, summarize functions from dplyr and spread from tidyr

Examples

1
2
3
4
## Not run: 
  fars_summarize_years(c(2013, 2014))

## End(Not run)

MarijusB/building_first_R_package documentation built on Aug. 6, 2020, 12:12 a.m.