make_file_name.Rd
Creates a file name using the standardized format 'PROJECT-SXX-Description-YYYY_MM_DD-HH_MM.ext' where 'PROJECT' is a abbreviation for a project name, and 'SXX' is a letter followed by a number indicating the script or analysis index. Both variables can be automatically specified from existing environmental variables.
make_file_name(
description,
extension,
project = NULL,
script = NULL,
date_time = NULL,
remove = FALSE,
path = ".",
env_variables = c("ABBR_PROJECT", "ABBR_SCRIPT")
)
A character string, a human-readable
description of the file (with words typically separated
by '_'
).
A character string, the file extension
(e.g., 'R'
, 'RData'
) - the period is
added automatically.
A character string, the abbreviation for the project name (can be inferred from environmental variables).
A character string, typically a one-letter abbreviation followed by a two-digit number indicating the script or analysis index.
A character string giving the date and time
(usually in the format 'YYYY_MM_DD-HH_MM'
) - if
not provided uses the current date and time instead.
Logical; if TRUE
removes any existing
files in the working directory with the same
project, script, description, and extension values.
A character string specifying the subfolder(s) for the file.
A character vector specifying the name of the environmental variables with the project and script abbreviations.
A character string.
make_file_name( 'Example', 'R' )
#> [1] "Example-2024_10_19-11_24.R"
make_file_name( 'Example_2', 'RData', project = 'EX', script = 'S01' )
#> [1] "EX-S01-Example_2-2024_10_19-11_24.RData"