Description Usage Arguments Value See Also Examples
View source: R/fars_functions.R
FARS files are of the form 'accident_YEAR.csv.bz2'. This function takes year
as an input, and returns the file name in the correct form. year
must be a scalar
of a type coercible into an integer, otherwise it will throw an error. No guarantee is made
that the file of the name created by this function exists
1 | make_filename(year)
|
year |
A four-digit year, in a format coerceable into an integer. Currently, only files
covering 2013-2013 are valid. If |
This function returns a string of the form 'accident_YEAR.csv.bz2', with YEAR replaced
by whatever is passed by year
. A string is returned, although
a warning is givin if year
cannot be coerced
to an integer, even though that may not form a valid filename. No path is prepended
fars_read
To easily load the file named in the returned string
1 2 3 4 | make_filename(2013)
make_filename('2014')
## Not run: fars_read(make_filename(2013))
## Not run: make_filename(12345) # still returns a filename, but the file does not exist
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.