file_stamp: create a date based version of a file name, mostly a wrapper...

View source: R/file_stamp.R

file_stampR Documentation

create a date based version of a file name, mostly a wrapper for timestamp

Description

create a date based version of a file name leveraging timestamp function and data format codes

Usage

file_stamp(
  path = tempdir(),
  stamp = format(Sys.time(), "%Y%m%d%H%M%S"),
  prefix = "logfile_V",
  suffix = ".txt",
  quiet = T
)

Arguments

path

location for file, defaults to tempfile()

stamp

how to label file - default is a custom format time

prefix

some sort of label like function name or analysis

suffix

file extension or other details

quiet

If TRUE, suppress printing file_stamp to the console

Details

create a date based version of a file name file name leveraging existing timestamp function and data format codes #'

This program is free software but it is provided WITHOUT WARRANTY and with ABSOLUTELY NO GUARANTEE of fitness or functionality for any purpose; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.


Revision History

1.0 Implemented

Value

character string with some new d

Author(s)

Some Body <some.body@somewhere.com>

See Also

timestamp
format
Sys.time
tempfile

Examples


file_stamp()
file_stamp(format(Sys.time(), "%Y_%m_%d_%H%M%S"))
file_stamp("1.1")
file_stamp("V1.1",prefix = "c:/temp/project1/myfile_",suffix=".RDS")



jstrunk001/RForInvt documentation built on April 17, 2025, 5:02 p.m.