datestamp: Datestamp character string

Description Usage Arguments Value Examples

Description

Add a datestamp to a character string, with considerations for filenames

Usage

1
2
datestamp(filenameOrSomething, location = c("beforeFileExt", "start",
  "end"), sep = ".", dateFormat = "%Y%m%d_%H%M")

Arguments

filenameOrSomething

character string to be datestamped

location

c("beforeFileExt", "start", "end"). where the datastamp should be inserted. default is before the file extension ("beforeFileExt")

sep

character that separates the datastamp and the original characters. default = "."

dateFormat

character formatting string. see format.POSIXct for more info.

Value

datastamped character string

Examples

1
2
datestamp("salad.pdf")    # "salad.20181211_1005.pdf"
datestamp("sample", location="end", sep=" ", dateFormat = "at %H%M")    #"sample at 1005"

Sabrina-Ge/sagesalad documentation built on June 4, 2019, 7:34 p.m.