Description Usage Arguments Value Warning Examples
View source: R/fars_functions.R
For the data provided by the US National Highway Traffic Safety
Administration in the Fatality Analysis Reporting System,
fars_read_years
will read the data for a specific period, and it will
return a variable (MONTH) in the dataset.
1 | fars_read_years(years)
|
years |
A numeric vector representing the years of a time period. |
A tibble object with the data of car fatalities by month for each year in the specified period.
Provided that a file does not exist for a specific year, the function will throw a warning that the information was not read.
1 2 3 4 5 6 7 8 | # We set the working directory where the compressed files are stored within
# the package.
WD <- setwd(system.file("extdata", package = "rfars"))
# Data with the car fatalities in 2013.
fars_read_years(2013)
# Data with the car fatalities in 2013 and 2014.
fars_read_years(c(2013, 2014))
setwd(WD)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.