filename provides a S3 class to represent file names, which is
This function creates a
filename object with a file path, tags,
extensions, date stamp or date-time stamp.
file name stem
path to the file
tags for the file name
date stamp (
time stamp (
whether to append a date/time stamped subdirectory to path
Either construct a
filename object with the
constructor or convert an existing file name from
Then, manage the tags and extensions of the
filename object with
set_ftime can be used
filename to modify file names.
tag to quickly add or replace a tag on a file name (as a
filename and coerce into a
time parameters can be specified as
character vectors or date/time objects. If
is given as a
POSIXct, it will override
If these parameters are both
NULL, automated date and time stamping
may be done and is controlled by
If this option is
NULL, 0, or less,
no date or time stamping will be done;
if it is 1, only date stamping will be done;
if it is 2 or greater, date-time stamping will be done (default).
NA to suppress date or
time stamping for a particular
Stamps are shown in ISO 8601 date format (
platforms and are thus omitted; hyphens are omitted from date-time stamps
By default, a date stamped subdirectory is appended to the filepath.
To disable this behaviour, set
FALSE or disable
path stamping globally by
options(filenamer.path.timestamp = 0).
This option is similar to
1 2 3 4 5 6 7 8 9 10 11
# file name is date-time stamped and put in subdirectory by default fn <- filename("data", tag="qc", ext="txt") print(as.character(fn)) # disable date-time stamping and subdirectory insertion fn2 <- filename("data", tag="qc", date=NA, time=NA, subdir=FALSE) print(as.character(fn2)) # creating a new file name from an existing one yields a new time stamp fn3 <- filename(fn) print(as.character(fn3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.