View source: R/providePlotFile.R
saveOldFile | R Documentation |
This checks if a file of given name already exists in the current directory, and if so saves a copy of it under an automatically generated name (see below).
saveOldFile(filename)
filename |
Name of file to be saved. |
This function copies the file named “first names.ext” under a name created by inserting a string of the form .old_
n
between “first names” and “.ext”, where n
is one more than the highest value for any file, matching the first names and extension, already in the current directory, and 0 if no file matches. For example, if filename
is my.beautiful.pdf
, it is copied as my.beautiful.old_0.pdf
if no my.beautiful.old_
n
.pdf
file exists, and is is copied as my.beautiful.old_4.pdf
if my.beautiful.old_3.pdf
(and any lower n
) file exists.
Returns ""
if no file with given name was present on disk, FALSE if it failed to copy an existing old file,
and the name of the copy if it successfully copied such a file.
## Not run:
saveOldFile("same.story")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.