make_filename: Make a filename from the years provided

Description Usage Arguments Details Value Examples

Description

The function creates a filename for a .csv.bz2 file based on the year argument in a form "accident_<year>.csv.bz2". The input is coerced to an integer. If coercion is not possible, it shows a warning message

Usage

1

Arguments

year

A vector or list indicating the years for which filenames are to be returned. Coerced to integer

Details

Works for all input that can be coerced to integers. NAs are introduced with a warning if input can't be coerced. See examples for usage.

Value

Returns a character vector in a format "accident_<year>.csv.bz2" that can be used as file names

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
make_filename(2006)
make_filename(2007:2010)

year_list <- list(2000, "2001", '2002')
make_filename(year_list)

# NAs introduced
make_filename("some_input")

## End(Not run)

faizan-khan-iit/fars documentation built on May 16, 2019, 9:59 a.m.