Description Usage Arguments Details Value Note Examples
View source: R/fars_functions.R
This function takes a four-digit number as its argument and returns a character vector containing a formatted combination of filename text template and year variable.
1 | make_filename(year)
|
year |
A four-digit number indicating the year in which the data collected. |
This function takes a four-digit number as its year
argument indicating the year in which the data has been collected.
Then it uses as.integer
to coerce it into integer type.
After that the function calls sprintf
to combine the
format string for filename with the year variable. The length of the output
will be equal to the longest input.
This function returns a character vector containing a formatted combination of file name template in text and year variable.
Because formats d
can only be used for integer values or sometimes
for logical values, the function use as.integer
to turn the
entry for year
argument into integer value.
1 2 3 4 | ## Not run:
make_filename(2013)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.