Description Usage Arguments Details Value Depends on Examples
View source: R/fars_functions.R
Reads the FARS data file(s) for the provided years in R as data frame table(s) and,
for each one of them, keeps only the MONTH
and year
variables.
1 | fars_read_years(years)
|
years |
A vector containing the years of interests as |
For each provided year the following steps are executed:
Build the FARS file name from year
(using make_filename
).
Read the FARS data file in R as a data frame table (using fars_read
).
Add a year
variable to the data frame table.
Keep MONTH
and year
variables only from the data frame table.
The data file names must be compliant with FARS pattern name. The data files must be located
in the working directory. If a file does not exist in the working directory the associated data
is set to NULL
.
A list containing the selected data as a data frame
table (see tbl_df
in the dplyr
package) for each provided year.
mutate
and select
in the dplyr
package.
1 2 3 4 5 | ## Not run:
fars_read_years(c(2013, 2014, 2015))
fars_read_years(c("2013", "2014", "2015"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.