fars_summarize_years: ""

Description Usage Arguments Details Value Note Examples

Description

This is a function summarizes the number of accidents for every month of all selected years (using the years argument) and returns tibble with the columns MONTH and for every year in years a column with the number of accidents.

Usage

1

Arguments

years

a numeric vector, representing the years for which the accident_data should be summarized. fars_summarize_years

Details

This function is a wrapper for the fars_read_years function. The external functions mutate, select, group_by, bind_rows, summarize, spread tbl_df and read_csv are included. Therefore the dplyr , tidyr and readr package has to be installed and loaded.

Value

This function returns a tibble which contains in the first collumn the month and in the following columns for every year in years the number of accidents. for all the years specified in the years argument. Every entry of the list is a data.frame with the columns year and MONTH.

Note

If for an element of the years argument no corresponding file is found a warning occurs.

Examples

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

floasdf/finalAssignment documentation built on May 6, 2019, 4:59 p.m.