create_dated_file_name.Rd
This is trivial function wraps paste
call and produces a string with Sys.time
and an
optional extension.
create_dated_file_name( x, timestamp_format = "%d-%m-%Y", sep = "-", extension )
x | A character vector. |
---|---|
timestamp_format | A string scalar for time format, as in
|
sep | A string scalar to separate file name parts. |
extension | A string scalar with file type extension. |
A character vector of length corresponding to x.
This simple function is convenient for automatically generating file names with the current date and/or time.
create_dated_file_name(x = "file_name")#> [1] "file_name-08-03-2021"create_dated_file_name(x = "annual_file", timestamp_format = "%Y")#> [1] "annual_file-2021"create_dated_file_name(x = "time_file", timestamp_format = "%H:%M:%S")#> [1] "time_file-19:39:50"