create_dated_file_name: Create Dated File/Path Name

Description Usage Arguments Details Value Examples

View source: R/create-dated-name.R

Description

This is trivial function wraps paste call and produces a string with Sys.time and an optional extension.

Usage

1
2
3
4
5
6
create_dated_file_name(
  x,
  timestamp_format = "%d-%m-%Y",
  sep = "-",
  extension
)

Arguments

x

A character vector.

timestamp_format

A string scalar for time format, as in strptime.

sep

A string scalar to separate file name parts.

extension

A string scalar with file type extension.

Details

This simple function is convenient for automatically generating file names with the current date and/or time.

Value

A character vector of length corresponding to x.

Examples

1
2
3
create_dated_file_name(x = "file_name")
create_dated_file_name(x = "annual_file", timestamp_format = "%Y")
create_dated_file_name(x = "time_file", timestamp_format = "%H:%M:%S")

konradedgar/KEmisc documentation built on April 15, 2021, 1:50 p.m.