Creates a file name given a prefix and other optional paramters for a figure or data file. Also checks if file exists.
makeFigName(prefix, ext = "pdf", prefix0 = "Fig", date = TRUE, path = ".") makeDatName(prefix, ext = "rda", prefix0 = "Dat", date = TRUE, path = ".")
pdf
for a figure and
rda
for a data file.Fig
for a figure and Dat
for a data file.date
) be used
as part of the file name? Default is TRUE
."."
.A character
with the figure file name.
TODO: If file exists, create the next increment.
makeFigName("foo")#> [1] "./Fig-foo-Tue-Jan-10-17:33:03-2017.pdf"makeFigName("foo", date = FALSE)#> [1] "./Fig-foo.pdf"makeDatName("foo", date = FALSE)#> [1] "./Dat-foo.rda"makeFigName("foo", path = "~/projects/big-project/figs")#> [1] "~/projects/big-project/figs/Fig-foo-Tue-Jan-10-17:33:03-2017.pdf"makeDatName("foo", path = "~/projects/big-project/Data")#> [1] "~/projects/big-project/Data/Dat-foo-Tue-Jan-10-17:33:03-2017.rda"