fars_summarize_years: Summarize 'Year' & 'Month' variables from the data.

Description Usage Arguments Value Note Examples

View source: R/fars_functions.R

Description

Summarizes Year & Month variables from the data, if the file is present in the working directory (in case year = 2013, 2014, 2015), otherwise prints 'Invalid year'

Usage

1

Arguments

years

The year for which the Year & Month variables are to be Summarized from the data. This should be integer.

Value

The count of number of observations present in the file (in case year = 2013, 2014, 2015) for each month. This is an object of class 'tbl_df'. In case the file is not present corresponding to the year supplied in the argument, it throws an error.

Note

Requires 'readr', 'dplyr' and 'tidyr' packages to be loaded first.

Examples

1
2
3
4
## Considering your data is in the present working directory
## The following would work fine and would return the subsetted data.
mydata <- fars_summarize_years(2014)
str(mydata)

abhinav-piplani/Assignment1 documentation built on May 27, 2019, 7:39 a.m.