Description Usage Arguments Details Value Note Examples
make_filename
is a function that generates the file name of the csv file to be
read.
1 | make_filename(year)
|
year |
An integer or string indicating the year that generate the data file. |
This function uses the year (input) to generate the file name for the Fatality
Analysis Reporting System (FARS) data file. It converts the year into an integer and
then uses the sprintf()
function to format the file name.
The name of the file as a string.
The year
parameter of this function must be an integer or a string with
number. If year
parameter is invalid, then an invalid file name will be generated
containing "NA" as the year in the file name which doesn't exist in the FARS database.
1 2 3 4 5 6 | ## Not run:
make_filename(2014) #generates "accident_2014.csv.bz2"
make_filename("2015") #generates "accident_2015.csv.bz2"
make_filename("abcd") #generates "accident_NA.csv.bz2"
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.