Description Usage Arguments Value Note Examples
View source: R/fars_functions.R
Subsets 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'.
1 | fars_read_years(years)
|
years |
The year for which the Year & Month variables are to be subsetted from the data. This should be integer. |
The data present in the file (in case year = 2013, 2014, 2015). This is an object of class 'tbl_df'. In case the file is not present corresponding to the year supplied in the argument, it returns a list of length 1 with object as NULL.
Requires 'readr' and 'dplyr' packages to be loaded first.
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_read_years(2014)
str(mydata)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.