Description Usage Arguments Value Note Examples
View source: R/fars_functions.R
fars_read_years lists the month and the year for each accident of the year called
1 | fars_read_years(years)
|
years |
The argument of the funtion is a vector of years |
returns a tibble (data.frame) of the length (number of accidents) x 2, whereas the columns return the month and the year in which the accident occured.
Receives name of the file from the make_filename function, and selects months. If there is no data for a specific year, there is an error message saying "invalid year: " with the year printed.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run: fars_read_years(2014)
# [[1]]
# A tibble: 30,056 x 2
# MONTH year
# <dbl> <dbl>
# 1 1 2014
# 2 1 2014
# 3 1 2014
# 4 1 2014
# 5 1 2014
# 6 1 2014
# 7 1 2014
# 8 1 2014
# 9 1 2014
# 10 1 2014
# ... with 30,046 more rows
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.